Files
hey/Jenkinsfile
Mpho raf 5065b8c55e
All checks were successful
golang-builds/hey/pipeline/pr-master This commit looks good
golang-builds/hey/pipeline/head This commit looks good
Finally deciding on using project names with branch name
2021-06-15 22:20:14 +02:00

31 lines
966 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=hey:${BRANCH_NAME}"
}
}
}
}
}