diff --git a/Jenkinsfile b/Jenkinsfile index 42aeb2de1..b37866d65 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,6 +35,7 @@ pipeline { break; } } + checkout scm script { env.GIT_COMMITTER_EMAIL = sh( @@ -49,45 +50,53 @@ pipeline { environment { NODE_ENV = '' } - nodejs('node-lts') { - sh "npm install --no-audit" - sh "gulp install" + steps { + nodejs('node-lts') { + sh "npm install --no-audit" + sh "gulp install" + } } } stage ('Build') { environment { CREDS = credentials('docker-registry') } - nodejs('node-lts') { - sh "gulp build" + steps { + nodejs('node-lts') { + sh "gulp build" + } + sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' + sh "docker-compose build --parallel" + sh "docker-compose push" } - sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' - sh "docker-compose build --parallel" - sh "docker-compose push" } stage ('Deploy') { environment { DOCKER_TLS_VERIFY = 1 } - parallel( - vch1: { - environment { - DOCKER_HOST = "${env.DOCKER_HOST_1}" + steps { + parallel( + vch1: { + environment { + DOCKER_HOST = "${env.DOCKER_HOST_1}" + } + sh "docker-compose pull" + sh "docker-compose up -d" + }, + vch2: { + environment { + DOCKER_HOST = "${env.DOCKER_HOST_2}" + } + sh "docker-compose pull" + sh "docker-compose up -d" } - sh "docker-compose pull" - sh "docker-compose up -d" - }, - vch2: { - environment { - DOCKER_HOST = "${env.DOCKER_HOST_2}" - } - sh "docker-compose pull" - sh "docker-compose up -d" - } - ) + ) + } } stage ('Cleanup') { - sh 'docker logout $REGISTRY' + steps { + sh 'docker logout $REGISTRY' + } } } post {