Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
print-demo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Administrator
print-demo
Commits
dc9d0865
Commit
dc9d0865
authored
Apr 23, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Jenkinsfile
parent
6aafb9d3
Pipeline
#86
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
56 deletions
+15
-56
Jenkinsfile
+15
-56
No files found.
Jenkinsfile
View file @
dc9d0865
pipeline
{
agent
any
stages
{
stage
(
'build'
)
{
when
{
branch
'dev'
}
steps
{
sh
'/apache-maven-3.6.3/bin/mvn clean package -Dmaven.test.skip=true -U'
}
post
{
success
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 沈涛 -c 项目编译成功进行下一阶段"
}
failure
{
step
([
$class
:
'Mailer'
,
notifyEveryUnstableBuild:
true
,
recipients:
"shentao@zhiweidata.com"
,
sendToIndividuals:
true
])
}
}
}
stage
(
'build image'
)
{
when
{
branch
'dev'
}
steps
{
sh
"sudo docker build -t harbor.docker.zhiweireach.com/application/qbjc:${env.BUILD_NUMBER} . "
}
post
{
success
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c 镜像构建成功进行下一阶段"
}
}
}
stage
(
'push image'
)
{
when
{
branch
'dev'
}
steps
{
sh
"sudo docker login --username admin --password JinxiaoZhang...701 harbor.docker.zhiweireach.com"
sh
"sudo docker push harbor.docker.zhiweireach.com/application/qbjc:${env.BUILD_NUMBER}"
}
post
{
success
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c 镜像push成功进行下一阶段"
}
}
}
stage
(
'deploy'
)
{
when
{
branch
'dev'
}
steps
{
sh
"/usr/local/bin/kubectl version"
sh
"/usr/local/bin/kubectl set image deployment/qbjc-background qbjc-background=harbor.docker.zhiweireach.com/application/qbjc:${env.BUILD_NUMBER} --record"
}
post
{
success
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c k8spod已部署更新成功"
}
}
}
node
{
stage
(
'SonarQube analysis'
)
{
withSonarQubeEnv
(
'sonar'
)
{
sh
'mvn clean package sonar:sonar'
}
}
}
stage
(
"Quality Gate"
){
timeout
(
1
)
{
def
qg
=
waitForQualityGate
(
'sonar'
)
if
(
qg
.
status
!=
'OK'
)
{
error
"Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
\ No newline at end of file
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