diff --git a/Jenkinsfile b/Jenkinsfile index 700025c09..f0c4ed122 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { } steps { script { - app = docker.build("willbla/train-schedule") + app = docker.build("tungnc2012/train-schedule") app.inside { sh 'echo $(curl localhost:8080)' } @@ -34,26 +34,5 @@ pipeline { } } } - stage('DeployToProduction') { - when { - branch 'master' - } - steps { - input 'Deploy to Production?' - milestone(1) - withCredentials([usernamePassword(credentialsId: 'webserver_login', usernameVariable: 'USERNAME', passwordVariable: 'USERPASS')]) { - script { - sh "sshpass -p '$USERPASS' -v ssh -o StrictHostKeyChecking=no $USERNAME@$prod_ip \"docker pull willbla/train-schedule:${env.BUILD_NUMBER}\"" - try { - sh "sshpass -p '$USERPASS' -v ssh -o StrictHostKeyChecking=no $USERNAME@$prod_ip \"docker stop train-schedule\"" - sh "sshpass -p '$USERPASS' -v ssh -o StrictHostKeyChecking=no $USERNAME@$prod_ip \"docker rm train-schedule\"" - } catch (err) { - echo: 'caught error: $err' - } - sh "sshpass -p '$USERPASS' -v ssh -o StrictHostKeyChecking=no $USERNAME@$prod_ip \"docker run --restart always --name train-schedule -p 8080:8080 -d willbla/train-schedule:${env.BUILD_NUMBER}\"" - } - } - } - } } -} \ No newline at end of file +}