Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
middleware-automatic
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
shenjunjie
middleware-automatic
Commits
faf2a3ac
Commit
faf2a3ac
authored
Apr 07, 2023
by
Lihua Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new Jenkinsfile
parent
bce31c9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
Jenkinsfile
+76
-0
No files found.
Jenkinsfile
0 → 100644
View file @
faf2a3ac
pipeline
{
agent
{
label
'jenkins-jnlp'
}
triggers
{
GenericTrigger
(
genericVariables:
[
[
key:
'ref'
,
value:
'$.ref'
]
],
causeString:
'Triggered on $ref'
,
token:
'middleware-automatic'
,
printContributedVariables:
true
,
printPostContent:
true
,
silentResponse:
false
,
regexpFilterText:
'$ref'
,
regexpFilterExpression:
'refs/heads/'
+
BRANCH_NAME
)
}
options
{
buildDiscarder
(
logRotator
(
numToKeepStr:
'5'
))
}
stages
{
stage
(
'build'
)
{
when
{
branch
'master'
}
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:
"shenjunjie@zhiweidata.com"
,
sendToIndividuals:
true
])
}
}
}
stage
(
'Transmission Jar'
)
{
when
{
branch
'master'
}
steps
{
sh
"scp middleware-automatic-center-server/target/middleware-automatic-center-server.jar nbzhiwei@192.168.0.38:/home/nbzhiwei/jar/middleware-automatic-2023"
sh
"scp middleware-automatic-center-son/target/middleware-automatic-center-son.jar nbzhiwei@192.168.0.38:/home/nbzhiwei/jar/middleware-automatic-2023"
}
post
{
failure
{
step
([
$class
:
'Mailer'
,
notifyEveryUnstableBuild:
true
,
recipients:
"zhangjinxiao@zhiweidata.com"
,
sendToIndividuals:
true
])
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c jar包传输失败"
}
}
}
stage
(
'Deploy'
)
{
when
{
branch
'master'
}
steps
{
sh
"supervisorctl-cli.go -active restart -host 192.168.0.38:9001 -name middleware-automatic-center-server -user 沈君杰"
sh
"supervisorctl-cli.go -active restart -host 192.168.0.38:9001 -name middleware-automatic-center-son -user 沈君杰"
}
post
{
success
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 沈君杰 -c 部署成功"
}
failure
{
step
([
$class
:
'Mailer'
,
notifyEveryUnstableBuild:
true
,
recipients:
"zhangjinxiao@zhiweidata.com"
,
sendToIndividuals:
true
])
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c 部署失败"
}
}
}
}
}
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