mirror of
https://github.com/ghndrx/docker-test-image.git
synced 2026-02-10 06:45:05 +00:00
s
This commit is contained in:
31
Jenkinsfile
vendored
31
Jenkinsfile
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user