mirror of
https://github.com/ghndrx/docker-test-image.git
synced 2026-02-10 14:55:14 +00:00
with cred
This commit is contained in:
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@@ -2,7 +2,6 @@ pipeline {
|
|||||||
agent any
|
agent any
|
||||||
environment {
|
environment {
|
||||||
DOCKERHUB_CREDENTIALS=credentials('dockerhub-cred')
|
DOCKERHUB_CREDENTIALS=credentials('dockerhub-cred')
|
||||||
SSH_CREDENTIALS=credentials('ssh-cred')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@@ -26,12 +25,15 @@ pipeline {
|
|||||||
|
|
||||||
stage('Pull and Deploy') {
|
stage('Pull and Deploy') {
|
||||||
steps {
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
usernamePassword(credentialsId: 'ssh-cred', usernameVariable: 'SSH_USER', passwordVariable: 'SSH_PASSWORD')
|
||||||
|
]) {
|
||||||
script {
|
script {
|
||||||
def remote = [:]
|
def remote = [:]
|
||||||
remote.name = 'ubuntu-kc'
|
remote.name = 'ubuntu-kc'
|
||||||
remote.host = '172.16.11.90'
|
remote.host = '172.16.11.90'
|
||||||
remote.user = "greg"
|
remote.user = "${SSH_USER}"
|
||||||
remote.password = "Password1!"
|
remote.password = "${SSH_PASSWORD}"
|
||||||
remote.allowAnyHosts = true
|
remote.allowAnyHosts = true
|
||||||
|
|
||||||
writeFile file: 'run-pull-deploy.sh', text: '''
|
writeFile file: 'run-pull-deploy.sh', text: '''
|
||||||
@@ -50,6 +52,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
|||||||
Reference in New Issue
Block a user