SonarQube stage Jenkins pipeline

Stage of SonarQube in Jenkinsfile

1

Votes

stage('Static analysis') {
            steps {
                dir('Source/cti') {
                    script {
                        withSonarQubeEnv('SonarQube67') {
                            withCredentials([string(credentialsId: 'sonarqube', variable: 'token')]) {
                                def json = readJSON file: 'package.json'
                                def APP_VERSION = json.version
                                def SONAR_SCANNER_HOME = tool name: 'sonar-scanner-3.0.3.778'
                                sh "${SONAR_SCANNER_HOME}/bin/sonar-scanner -Dsonar.login=${token} -Dsonar.sources=src/app -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.sourceEncoding=UTF-8 -Dsonar.ts.tslintconfigpath=tslint.json -Dsonar.typescript.lcov.reportPaths=coverage/lcov-report/lcov.info -Dsonar.projectKey=ufs-cti-panel -Dsonar.projectVersion=${APP_VERSION} -Dsonar.exclusions=**/*-test.ts*,**/*.js*,**/*.d.ts,**/*.css,**/*.scss,**/docs/**,**/*.png,**/*.jpg -X"
                            }
                        }
                    }
                }
            }

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png