mirror of
https://github.com/ghndrx/docker-test-image.git
synced 2026-02-13 00:05:03 +00:00
s
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -26,15 +26,16 @@ pipeline {
|
|||||||
|
|
||||||
stage('Pull and Deploy') {
|
stage('Pull and Deploy') {
|
||||||
steps {
|
steps {
|
||||||
def remote [:]
|
|
||||||
remote.name = 'ubuntu-kc'
|
|
||||||
remote.host = '172.16.11.90'
|
|
||||||
remote.allowAnyHosts = true
|
|
||||||
withCredentials([
|
withCredentials([
|
||||||
sshUserPrivateKey(credentialsId: 'ssh-cred', keyFileVariable: 'identity', usernameVariable: 'userName')
|
sshUserPrivateKey(credentialsId: 'ssh-cred', keyFileVariable: 'identity', usernameVariable: 'userName')
|
||||||
]) {
|
]) {
|
||||||
|
script {
|
||||||
|
def remote = [:]
|
||||||
|
remote.name = 'ubuntu-kc'
|
||||||
|
remote.host = '172.16.11.90'
|
||||||
remote.user = userName
|
remote.user = userName
|
||||||
remote.identityFile = identity
|
remote.identityFile = identity
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
|
||||||
writeFile file: 'run-pull-deploy.sh', text: '''
|
writeFile file: 'run-pull-deploy.sh', text: '''
|
||||||
docker pull aisthanestha/docker-test-image:latest
|
docker pull aisthanestha/docker-test-image:latest
|
||||||
@@ -49,6 +50,7 @@ pipeline {
|
|||||||
// Execute the script file on the remote host
|
// Execute the script file on the remote host
|
||||||
sshCommand remote: remote, command: 'chmod +x ~/run-pull-deploy.sh && ~/run-pull-deploy.sh'
|
sshCommand remote: remote, command: 'chmod +x ~/run-pull-deploy.sh && ~/run-pull-deploy.sh'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user