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
e0a417bb
You need to sign in or sign up before continuing.
Commit
e0a417bb
authored
Apr 07, 2023
by
Lihua Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Jenkinsfile
parent
46cff39b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
1 deletions
+50
-1
Jenkinsfile
+50
-1
No files found.
Jenkinsfile
View file @
e0a417bb
...
@@ -49,7 +49,7 @@ pipeline {
...
@@ -49,7 +49,7 @@ pipeline {
}
}
}
}
}
}
stage
(
'Deploy'
)
{
stage
(
'Deploy
server
'
)
{
when
{
branch
'master'
}
when
{
branch
'master'
}
steps
{
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-server -user 沈君杰"
...
@@ -69,6 +69,55 @@ pipeline {
...
@@ -69,6 +69,55 @@ pipeline {
}
}
}
}
stage
(
'build image'
)
{
when
{
branch
'master'
}
steps
{
withCredentials
([
usernamePassword
(
credentialsId:
'dockerHub'
,
passwordVariable:
'dockerHubPassword'
,
usernameVariable:
'dockerHubUser'
)])
{
sh
"docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweidata.top"
sh
"docker build -t harbor.docker.zhiweidata.top/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER} . "
}
}
post
{
failure
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c ' 镜像构建失败请登录 Jenkins 查看具体信息'"
}
}
}
stage
(
'push image'
)
{
when
{
branch
'master'
}
steps
{
withCredentials
([
usernamePassword
(
credentialsId:
'dockerHub'
,
passwordVariable:
'dockerHubPassword'
,
usernameVariable:
'dockerHubUser'
)])
{
sh
"docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweidata.top"
sh
"docker push harbor.docker.zhiweidata.top/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER}"
}
}
post
{
failure
{
sh
"/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c ' 镜像上传失败请登录 Jenkins 查看具体信息'"
}
}
}
stage
(
'deploy son'
)
{
when
{
branch
'master'
}
steps
{
sh
"kubectl -n daemon set image deployment/middleware-automatic-center-son middleware-automatic-center-son=harbor.docker.zhiweidata.top/daemon/${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 'kubernetes pod 更新部署失败请查看具体原因'"
}
}
}
}
}
}
}
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