mod-jenkfile #1

Merged
admin-tea merged 4 commits from mod-jenkfile into master 2021-06-15 22:33:53 +02:00

17
Jenkinsfile vendored
View File

@@ -1,17 +1,30 @@
pipeline {
agent { docker { image 'golang:1.15-alpine'
args '-e XDG_CACHE_HOME="/tmp" -e CGO_ENABLED=0 -e GOCACHE="/tmp/.cache"'} }
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}"
}
}
}
}
}