- update gitea Jenkinsfile to update instead of create stack if stack exists

This commit is contained in:
2018-10-27 09:08:28 -04:00
parent 6791f17a51
commit c263643d37

View File

@@ -8,13 +8,19 @@ node('docker') {
stage('build') { stage('build') {
dir(workdir) { dir(workdir) {
//nothing to do sh "DOCKER_HOST=dkhost:2376 docker-compose -f docker-compose.yml pull"
} }
} }
stage('deploy') { stage('deploy') {
dir(workdir) { dir(workdir) {
sh "DOCKER_HOST=dkhost:2376 docker stack deploy -c docker-compose.yml gitea" sh '''export DOCKER_HOST=dkhost:2376
if docker stack ls | grep gitea; then
docker service update gitea_app
else
docker stack deploy -c docker-compose.yml gitea
fi'''
} }
} }