From 8b7906023410a805dbd9cb673e746d355a2d7202 Mon Sep 17 00:00:00 2001 From: zhouxiunai <154707516@qq.com> Date: Sun, 4 Nov 2018 18:47:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95jenkins=20ssh=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=BF=9C=E7=A8=8B=E6=9C=BA=E5=99=A8=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index afee9ac..5485e4d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,9 +13,18 @@ pipeline { } } + stage('deploy') { + def remote = [:] + remote.name = "node-1" + remote.host = "130.120.3.231" + remote.allowAnyHosts = true + 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' } } }