Skip to content

Commit

Permalink
Extend resource references to cater for secrets (#1718)
Browse files Browse the repository at this point in the history
* Add secret references to step metadata

* Update references

* update generated files
  • Loading branch information
OliverNocon authored Jun 25, 2020
1 parent d1130a1 commit bb8cd30
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/artifactPrepareVersion_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/sonarExecuteScan_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions pkg/config/stepmeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ type StepParameters struct {

// ResourceReference defines the parameters of a resource reference
type ResourceReference struct {
Name string `json:"name"`
Param string `json:"param"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Param string `json:"param,omitempty"`
Aliases []Alias `json:"aliases,omitempty"`
}

// Alias defines a step input parameter alias
Expand Down
6 changes: 6 additions & 0 deletions resources/metadata/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ spec:
scope:
- PARAMETERS
secret: true
resourceRef:
- name: sonarTokenCredentialsId
type: secret
aliases:
- name: sonarToken
- name: organization
Expand Down Expand Up @@ -137,6 +140,9 @@ spec:
scope:
- PARAMETERS
secret: true
resourceRef:
- name: githubTokenCredentialsId
type: secret
- name: disableInlineComments
type: bool
description: "Pull-Request only: Disables the pull-request decoration with inline comments. DEPRECATED: only supported in SonarQube < 7.2"
Expand Down
8 changes: 8 additions & 0 deletions resources/metadata/versioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ spec:
- STAGES
- STEPS
secret: true
resourceRef:
- name: gitHttpsCredentialsId
type: secret
param: password
- name: projectSettingsFile
aliases:
- name: maven/projectSettingsFile
Expand Down Expand Up @@ -212,6 +216,10 @@ spec:
- STAGES
- STEPS
secret: true
resourceRef:
- name: gitHttpsCredentialsId
type: secret
param: username
- name: versioningTemplate
type: string
description: "DEPRECATED: Defines the template for the automatic version which will be created"
Expand Down

0 comments on commit bb8cd30

Please sign in to comment.