diff --git a/Jenkinsfile b/Jenkinsfile index 19f1524..a3b8624 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,7 @@ pipeline{ environment { DOCKERHUB_CREDENTIALS=credentials('dockerhub-cred') } + stages { stage('Build') { steps { @@ -35,22 +36,22 @@ pipeline{ // } // } // } - stage('Pull and Deploy') - steps { - // Send commands to remote Docker host via SSH - script { - sshCommand remote: [ - credentialsId: 'SSH_CREDENTIALS', - host: '172.16.11.90', - username: '172.16.11.90' - ], command: ''' - docker pull aisthanestha/docker-test-image:latest - docker stop docker-test-image - docker rm docker-test-image - docker run -d --name docker-test-image aisthanestha/docker-test-image:latest - ''' - } + stage('Pull and Deploy') + steps { + // Send commands to remote Docker host via SSH + script { + sshCommand remote: [ + credentialsId: 'SSH_CREDENTIALS', + host: '172.16.11.90', + username: '172.16.11.90' + ], command: ''' + docker pull aisthanestha/docker-test-image:latest + docker stop docker-test-image + docker rm docker-test-image + docker run -d --name docker-test-image aisthanestha/docker-test-image:latest + ''' } + } post { always {