Update Jenkinsfile

This commit is contained in:
Nana Janashia
2020-11-22 11:38:52 +00:00
parent 8b1aa75d8e
commit 12f88937ab

9
Jenkinsfile vendored
View File

@@ -20,7 +20,7 @@ pipeline {
steps {
script {
echo 'building application jar...'
buildJar()
}
}
}
@@ -28,17 +28,16 @@ pipeline {
steps {
script {
echo 'building docker image...'
buildImage(env.IMAGE_NAME)
dockerLogin()
dockerPush(env.IMAGE_NAME)
}
}
}
stage('deploy') {
steps {
script {
def executeScript = "bash ./test.sh"
sshagent(['ec2-server-key']) {
sh "bash ./test.sh"
sh "ssh -o StrictHostKeyChecking=no ec2-user@35.180.251.121 ${executeScript}"
}
}
}