diff --git a/Jenkinsfile b/Jenkinsfile index 23241c1..5034e03 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,6 +62,7 @@ podTemplate( node (label) { def workspace = pwd() + def shortCommit stage('Clone Repository') { checkout ([$class: "GitSCM", branches: scm.branches, @@ -80,10 +81,10 @@ podTemplate( fi apk add --no-cache curl gcc musl-dev curl \ - --silent \ - --location \ - --cacert "${workspace}/test-chamber-13.lan.root.crt" \ - https://nexus.c.test-chamber-13.lan/repository/github-releases/jstemmer/go-junit-report/releases/download/v1.0.0/go-junit-report-v1.0.0-linux-amd64.tar.gz \ + --silent \ + --location \ + --cacert "${workspace}/test-chamber-13.lan.root.crt" \ + https://nexus.c.test-chamber-13.lan/repository/github-releases/jstemmer/go-junit-report/releases/download/v1.0.0/go-junit-report-v1.0.0-linux-amd64.tar.gz \ | tar -z -x -f - -C /usr/local/bin ln -s "${workspace}" "/go/src/${env.JOB_BASE_NAME}" cd "/go/src/${env.JOB_BASE_NAME}" @@ -95,9 +96,9 @@ podTemplate( } } - stage('Prepare SonarScanner') { + stage('Prepare SonarScanner') { def sonarScannerConfig = """ -sonar.projectKey=emonesp-exporter +sonar.projectKey=${env.JOB_BASE_NAME.replace(" ", "-")} sonar.projectVersion=${shortCommit} sonar.sources=. sonar.exclusions=**/*_test.go,**/vendor/**,**/testdata/*