测试jenkins ssh登录远程机器操作
This commit is contained in:
Vendored
+9
@@ -13,8 +13,17 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stage('deploy') {
|
||||
def remote = [:]
|
||||
remote.name = "node-1"
|
||||
remote.host = "130.120.3.231"
|
||||
remote.allowAnyHosts = true
|
||||
|
||||
steps {
|
||||
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