From 01d675eeeae171b090eae75f2cfd4b44d11c93f4 Mon Sep 17 00:00:00 2001 From: zhouxiunai <154707516@qq.com> Date: Tue, 6 Nov 2018 15:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=8D=E5=88=B6=E6=97=B6?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=BC=BA=E5=B0=91=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkins/Jenkinsfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index bbb7312..f4d57ba 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,17 +1,17 @@ node { checkout scm - docker.image('teracyangular-cli').inside() { + docker.image('teracy/angular-cli').inside() { stage('build'){ - sh 'npm config set registry httpregistry.npm.taobao.org' + sh 'npm config set registry http://registry.npm.taobao.org/' sh 'npm install' sh 'ng build' } } - def imagesName = '130.120.3.193com.gzzn.ommsadmin-web0.0.1-SNAPSHOT' + def imagesName = '130.120.3.193/com.gzzn.omms/admin-web:0.0.1-SNAPSHOT' stage('Image Build And Push'){ - docker.withRegistry('http130.120.3.193', 'privateDockerId') { + docker.withRegistry('http://130.120.3.193', 'privateDockerId') { docker.build(imagesName).push() } } @@ -20,18 +20,18 @@ node { stage('deploy'){ def remote = [:] - remote.name = airport-dev - remote.host = 130.120.3.231 + remote.name = "airport-dev" + remote.host = "130.120.3.231" remote.allowAnyHosts = true - withCredentials([sshUserPrivateKey(credentialsId 'e41b57a4-436a-4617-817c-9e3f25a8a47f', keyFileVariable 'kfIdentity', passphraseVariable 'pVariable', usernameVariable 'userName')]) { + withCredentials([sshUserPrivateKey(credentialsId: 'e41b57a4-436a-4617-817c-9e3f25a8a47f', keyFileVariable: 'kfIdentity', passphraseVariable: 'pVariable', usernameVariable: 'userName')]) { remote.user = userName remote.identityFile = kfIdentity - sshCommand remote remote, command docker stop adminweb,sudo true ,failOnError false - sshCommand remote remote, command docker rm adminweb,sudo true ,failOnError false - sshCommand remote remote, command docker rmi 130.120.3.193com.gzzn.ommsadmin-web0.0.1-SNAPSHOT,sudo true ,failOnError false - sshCommand remote remote, command docker run -d -p 9680 --name adminweb 130.120.3.193com.gzzn.ommsadmin-web0.0.1-SNAPSHOT,sudo true + sshCommand remote: remote, command: "docker stop adminweb",sudo: true ,failOnError: false + sshCommand remote: remote, command: "docker rm adminweb",sudo: true ,failOnError: false + sshCommand remote: remote, command: "docker rmi 130.120.3.193/com.gzzn.omms/admin-web:0.0.1-SNAPSHOT",sudo: true ,failOnError: false + sshCommand remote: remote, command: "docker run -d -p 96:80 --name adminweb 130.120.3.193/com.gzzn.omms/admin-web:0.0.1-SNAPSHOT",sudo: true } } } \ No newline at end of file