diff --git a/Jenkinsfile b/Jenkinsfile index 1d728a4c..1b448465 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,16 +45,18 @@ pipeline { stage('Deploy') { steps { echo 'Deploying....' - if (env.GIT_BRANCH == 'master' || env.GIT_BRANCH == 'develop') { - sh """ - cd ./jenkins/${ENV:GIT_BRANCH} - docker-compose stop | true - docker-compose up -d - """ - } else { - sh """ - docker push tikazyq/crawlab:${ENV:TAG} - """ + script { + if (env.GIT_BRANCH == 'master' || env.GIT_BRANCH == 'develop') { + sh """ + cd ./jenkins/${ENV:GIT_BRANCH} + docker-compose stop | true + docker-compose up -d + """ + } else { + sh """ + docker push tikazyq/crawlab:${ENV:TAG} + """ + } } } }