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
f8749c51
Commit
f8749c51
authored
Feb 25, 2021
by
chenzhiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete Jenkinsfile
parent
c2f3375e
Pipeline
#130
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
75 deletions
+0
-75
Jenkinsfile
+0
-75
No files found.
Jenkinsfile
deleted
100644 → 0
View file @
c2f3375e
pipeline
{
agent
{
label
'jenkins-jnlp'
}
triggers
{
GenericTrigger
(
genericVariables:
[
[
key:
'ref'
,
value:
'$.ref'
]
],
causeString:
'Triggered on $ref'
,
token:
'print-demo'
,
printContributedVariables:
true
,
printPostContent:
true
,
silentResponse:
false
,
regexpFilterText:
'$ref'
,
regexpFilterExpression:
'refs/heads/'
+
BRANCH_NAME
)
}
options
{
timeout
(
time:
10
,
unit:
'MINUTES'
)
}
stages
{
stage
(
'build'
)
{
steps
{
sh
'/apache-maven-3.6.3/bin/mvn clean package -Dmaven.test.skip=true -U'
}
post
{
failure
{
step
([
$class
:
'Mailer'
,
notifyEveryUnstableBuild:
true
,
recipients:
"zhangjinxiao@zhiweidata.com"
,
sendToIndividuals:
true
])
}
}
}
stage
(
'build image'
)
{
steps
{
withCredentials
([
usernamePassword
(
credentialsId:
'dockerHub'
,
passwordVariable:
'dockerHubPassword'
,
usernameVariable:
'dockerHubUser'
)])
{
sh
"docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweireach.com"
sh
"docker build -t harbor.docker.zhiweireach.com/application/${env.JOB_NAME}:${env.BUILD_NUMBER} . "
}
}
post
{
failure
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 陈志强 -c '镜像构建失败请登录 jenkins查看具体信息'"
}
}
}
stage
(
'push image'
)
{
steps
{
withCredentials
([
usernamePassword
(
credentialsId:
'dockerHub'
,
passwordVariable:
'dockerHubPassword'
,
usernameVariable:
'dockerHubUser'
)])
{
sh
"docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweireach.com"
sh
"docker push harbor.docker.zhiweireach.com/application/${env.JOB_NAME}:${env.BUILD_NUMBER}"
}
}
post
{
failure
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 陈志强 -c '镜像上传失败请登录 jenkins查看具体信息'"
}
}
}
stage
(
'deploy'
)
{
steps
{
sh
"kubectl -n application set image deployment/print-demo print-demo=harbor.docker.zhiweireach.com/application/${env.JOB_NAME}:${env.BUILD_NUMBER} --record"
}
post
{
success
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c k8spod已部署更新成功"
}
failure
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 陈志强 -c 'k8spod 部署更新失败'"
}
}
}
}
}
\ 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