Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
signal
traffic-signal-platform
Commits
ff69c276
Commit
ff69c276
authored
Feb 09, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
信控优化-添加Jenkinsfile
parent
f99357b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
Jenkinsfile-opt
Jenkinsfile-opt
+56
-0
No files found.
Jenkinsfile-opt
0 → 100644
View file @
ff69c276
pipeline {
agent {
label 'node59'
}
stages {
stage('检测环境') {
steps {
sh '''java -version
mvn -v
git version
docker -v'''
}
}
stage('拉取代码') {
steps {
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模块') {
steps {
sh '''
mvn install -DsendCredentialsOverHttp=true
mvn -pl signal-opt-service clean package -Dmaven.test.skip=true jib:build -DsendCredentialsOverHttp=true
'''
}
}
stage('删除opt模块镜像和容器') {
steps {
sh '''
echo \'检查容器是否存在\'
containerid=`docker ps -a|grep signal-opt-service|awk \'{print $1}\'`
if [ "$containerid" != "" ];then
echo \'容器存在,删除容器\'
docker rm -f $containerid
fi
echo \'检查镜像是否存在\'
imageid=`docker images|grep signal-opt-service|awk \'{print $3}\'`
if [ "$imageid" != "" ];then
echo \'删除镜像\'
docker rmi -f $imageid
fi
'''
}
}
stage('拉取opt模块镜像') {
steps {
sh 'docker pull 10.100.1.59:5000/xinkong/signal-opt-service:0.2.1'
}
}
stage('运行opt模块容器') {
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'
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment