2020-03-23 11:38:31 +02:00
metadata :
name : sonarExecuteScan
description : Executes the Sonar scanner
longDescription : The step executes the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) cli command to scan the defined sources and publish the results to a SonarQube instance.
spec :
inputs :
params :
2020-04-08 12:55:46 +02:00
- name : instance
type : string
description : "Jenkins only: The name of the SonarQube instance defined in the Jenkins settings. DEPRECATED: use host parameter instead"
scope :
- PARAMETERS
- STAGES
- STEPS
default : 'SonarCloud'
2020-03-23 11:38:31 +02:00
- name : host
type : string
description : The URL to the Sonar backend.
scope :
- PARAMETERS
- STAGES
- STEPS
aliases :
- name : sonarServerUrl
- name : token
type : string
description : Token used to authenticate with the Sonar Server.
scope :
- PARAMETERS
2020-04-16 14:37:45 +02:00
secret : true
2020-06-25 16:33:38 +02:00
resourceRef :
- name : sonarTokenCredentialsId
type : secret
2020-03-23 11:38:31 +02:00
aliases :
- name : sonarToken
- name : organization
type : string
description : "SonarCloud.io only: Organization that the project will be assigned to in SonarCloud.io."
scope :
- PARAMETERS
- STAGES
- STEPS
- name : customTlsCertificateLinks
2020-07-27 15:01:30 +02:00
type : "[]string"
description : List of download links to custom TLS certificates. This is required to ensure trusted connections to instances with custom certificates.
2020-03-23 11:38:31 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
- name : sonarScannerDownloadUrl
type : string
description : "URL to the sonar-scanner-cli archive."
2020-06-25 13:53:22 +02:00
default : https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip
2020-03-23 11:38:31 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
- name : projectVersion
type : string
description :
"The project version that is reported to SonarQube."
scope :
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : artifactVersion
- name : options
2020-04-08 12:55:46 +02:00
type : "[]string"
2020-03-23 11:38:31 +02:00
description : A list of options which are passed to the sonar-scanner.
scope :
- PARAMETERS
- STAGES
- STEPS
2020-04-08 12:55:46 +02:00
# Parameters for non-PR scans
- name : branchName
type : string
description : "Non-Pull-Request only: Name of the SonarQube branch that should be used to report findings to."
scope :
- PARAMETERS
- STAGES
- STEPS
# Parameters for PR-Handling
2020-03-23 11:38:31 +02:00
- name : changeId
type : string
description : "Pull-Request only: The id of the pull-request."
scope :
- PARAMETERS
- name : changeBranch
type : string
description : "Pull-Request only: The name of the pull-request branch."
scope :
- PARAMETERS
- name : changeTarget
type : string
description : "Pull-Request only: The name of the base branch."
scope :
- PARAMETERS
- name : pullRequestProvider
type : string
description : "Pull-Request only: The scm provider."
default : GitHub
2020-04-27 15:16:01 +02:00
possibleValues :
- GitHub
2020-03-23 11:38:31 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
- name : owner
type : string
description : "Pull-Request only: The owner of the scm repository."
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
aliases :
- name : githubOrg
resourceRef :
- name : commonPipelineEnvironment
param : github/owner
- name : repository
type : string
description : "Pull-Request only: The scm repository."
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
aliases :
- name : githubRepo
resourceRef :
- name : commonPipelineEnvironment
param : github/repository
2020-04-08 12:55:46 +02:00
# Parameters for legacy PR-Handling
2020-03-23 11:38:31 +02:00
- name : githubToken
type : string
description : "Pull-Request only: Token for Github to set status on the Pull-Request."
scope :
- PARAMETERS
2020-04-16 14:37:45 +02:00
secret : true
2020-06-25 16:33:38 +02:00
resourceRef :
- name : githubTokenCredentialsId
type : secret
2020-03-23 11:38:31 +02:00
- name : disableInlineComments
type : bool
description : "Pull-Request only: Disables the pull-request decoration with inline comments. DEPRECATED: only supported in SonarQube < 7.2"
scope :
- PARAMETERS
- STAGES
- STEPS
- name : legacyPRHandling
type : bool
description : "Pull-Request only: Activates the pull-request handling using the [GitHub Plugin](https://docs.sonarqube.org/display/PLUG/GitHub+Plugin). DEPRECATED: only supported in SonarQube < 7.2"
scope :
- PARAMETERS
- STAGES
- STEPS
- name : githubApiUrl
type : string
description : "Pull-Request only: The URL to the Github API. see [GitHub plugin docs](https://docs.sonarqube.org/display/PLUG/GitHub+Plugin#GitHubPlugin-Usage) DEPRECATED: only supported in SonarQube < 7.2"
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
default : https://api.github.com
secrets :
- name : sonarTokenCredentialsId
type : jenkins
description : Jenkins 'Secret text' credentials ID containing the token used to authenticate with the Sonar Server.
- name : githubTokenCredentialsId
type : jenkins
description : Jenkins 'Secret text' credentials ID containing the token used to authenticate with the Github Server.
2020-05-14 13:46:40 +02:00
outputs :
resources :
- name : influx
type : influx
params :
- name : step_data
fields :
- name : sonar
2020-03-23 11:38:31 +02:00
containers :
- name : sonar
image : node:lts-stretch