Skip to content

ooga/cloud-builder-sonar-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

cloud-builder-sonar-scanner

Sonar scanner step for google cloud builder

Forked from https://github.com/SonarSource/sonar-scanner-cli-docker adapted for cloud build

Example

steps:
  - name: "ooga/cloud-builder-sonar-scanner"
    env:
      - SONAR_BRANCH_NAME=your-branch-name
    secretEnv:
      - SONAR_TOKEN
    args: ["-Dsonar.projectVersion=1.0.0"]

Sonar project configuration can be set in file sonar-project.properties, via env variables, or using docker args

Env variables

List available here

Extracted from https://docs.sonarqube.org/latest/analysis/analysis-parameters/ with JS function

JSON.stringify(
  $$("table td:first-child code")
    .map(function(el) {
      return el.innerText;
    })
    .filter(function(val) {
      return ![
        "sonar.analysis.[yourKey]",
        "sonar.cpd.${language}.minimumtokens",
        "sonar.cpd.${language}.minimumLines",
        "sonar.links.scm_dev"
      ].includes(val);
    })
);

About

Sonar scanner step for google cloud builder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published