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