Commit 5c64e8c5 authored by hanbing's avatar hanbing

信控优化-更新Jenkinsfile

parent 7d5f1232
...@@ -16,25 +16,25 @@ pipeline { ...@@ -16,25 +16,25 @@ pipeline {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'ae6a8c63-b80d-4b84-ab7e-20592bae46be', url: 'http://10.100.1.59/signal/traffic-signal-platform.git']]]) checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'ae6a8c63-b80d-4b84-ab7e-20592bae46be', url: 'http://10.100.1.59/signal/traffic-signal-platform.git']]])
} }
} }
stage('编译构建opt模块') { stage('编译构建optimize模块') {
steps { steps {
sh ''' sh '''
mvn install -DsendCredentialsOverHttp=true mvn install -DsendCredentialsOverHttp=true
mvn -pl signal-opt-service clean package -Dmaven.test.skip=true jib:build -DsendCredentialsOverHttp=true mvn -pl signal-optimize-service clean package -Dmaven.test.skip=true jib:build -DsendCredentialsOverHttp=true
''' '''
} }
} }
stage('删除opt模块镜像和容器') { stage('删除optimize模块镜像和容器') {
steps { steps {
sh ''' sh '''
echo \'检查容器是否存在\' echo \'检查容器是否存在\'
containerid=`docker ps -a|grep signal-opt-service|awk \'{print $1}\'` containerid=`docker ps -a|grep signal-optimize-service|awk \'{print $1}\'`
if [ "$containerid" != "" ];then if [ "$containerid" != "" ];then
echo \'容器存在,删除容器\' echo \'容器存在,删除容器\'
docker rm -f $containerid docker rm -f $containerid
fi fi
echo \'检查镜像是否存在\' echo \'检查镜像是否存在\'
imageid=`docker images|grep signal-opt-service|awk \'{print $3}\'` imageid=`docker images|grep signal-optimize-service|awk \'{print $3}\'`
if [ "$imageid" != "" ];then if [ "$imageid" != "" ];then
echo \'删除镜像\' echo \'删除镜像\'
docker rmi -f $imageid docker rmi -f $imageid
...@@ -42,14 +42,14 @@ pipeline { ...@@ -42,14 +42,14 @@ pipeline {
''' '''
} }
} }
stage('拉取opt模块镜像') { stage('拉取optimize模块镜像') {
steps { steps {
sh 'docker pull 10.100.1.59:5000/xinkong/signal-opt-service:0.2.1' sh 'docker pull 10.100.1.59:5000/xinkong/signal-optimize-service:0.2.1'
} }
} }
stage('运行opt模块容器') { stage('运行optimize模块容器') {
steps { steps {
sh 'docker run -p 39001:39001 -p 15117:15117 -itd --name signal-opt-service 10.100.1.59:5000/xinkong/signal-opt-service:0.2.1' sh 'docker run -p 39001:39001 -p 15117:15117 -itd --name signal-optimize-service 10.100.1.59:5000/xinkong/signal-optimize-service:0.2.1'
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment