测试jenkins ssh登录远程机器操作
This commit is contained in:
Vendored
+10
-1
@@ -13,9 +13,18 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stage('deploy') {
|
stage('deploy') {
|
||||||
|
def remote = [:]
|
||||||
|
remote.name = "node-1"
|
||||||
|
remote.host = "130.120.3.231"
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
sh 'echo deploy'
|
withCredentials([sshUserPrivateKey(credentialsId: 'e41b57a4-436a-4617-817c-9e3f25a8a47f', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
|
||||||
|
sshCommand remote: remote, command: 'docker stop adminapi'
|
||||||
|
}
|
||||||
|
sh 'echo deploy'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user