Files
hey/Jenkinsfile
Mpho raf c53c2cb4ed
All checks were successful
golang-builds/hey/pipeline/head This commit looks good
Fix using build tag
2021-06-15 22:09:40 +02:00

31 lines
975 B
Groovy

pipeline {
agent none
stages {
stage('build') {
agent { docker { image 'golang:1.15-alpine'
args '-e XDG_CACHE_HOME="/tmp" -e CGO_ENABLED=0 -e GOCACHE="/tmp/.cache"'} }
steps {
sh 'go version'
sh 'go env'
}
}
stage('Test') {
agent { docker { image 'golang:1.15-alpine'
args '-e XDG_CACHE_HOME="/tmp" -e CGO_ENABLED=0 -e GOCACHE="/tmp/.cache"'} }
steps {
sh 'go test'
}
}
stage('Sonar-Test') {
agent {
docker { image 'sonarsource/sonar-scanner-cli' }
}
steps {
withSonarQubeEnv('mysonar') { // If you have configured more than one global server connection, you can specify its name
sh "sonar-scanner -Dsonar.projectKey=${BUILD_TAG}:${BRANCH_NAME}"
}
}
}
}
}