Skip to content
Snippets Groups Projects
Commit e833c930 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Update Jenkinsfile

- change label (jenkins-slave should have docker-compose installed)
- only push when the current commit is a tag
parent eb66aa91
No related branches found
No related tags found
No related merge requests found
pipeline { pipeline {
agent { label 'docker' } agent { label 'docker-compose' }
environment {
GIT_TAG = sh(returnStdout: true, script: 'git describe --exact-match || true').trim()
}
stages { stages {
stage('Refresh') { stage('Refresh') {
steps { steps {
slackSend (color: 'good', message: "STARTED: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>") slackSend (color: 'good', message: "STARTED: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>")
sh 'git fetch --tags'
sh 'make clean' sh 'make clean'
sh 'make refresh' sh 'make refresh'
} }
...@@ -26,20 +29,19 @@ pipeline { ...@@ -26,20 +29,19 @@ pipeline {
} }
} }
stage('Push') { stage('Push') {
when {
expression { "$GIT_TAG" != "" }
}
steps { steps {
sh 'make tag' sh 'make tag'
sh 'make push' sh 'make push'
} }
} }
stage('Clean') {
steps {
sh 'make clean'
}
}
} }
post { post {
always { always {
sh 'make clean'
/* clean up the workspace */ /* clean up the workspace */
deleteDir() deleteDir()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment