Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
global-jenkinsfile
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
QA
global-jenkinsfile
Commits
6464715c
Commit
6464715c
authored
Apr 23, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部署服务增加请求参数:域名
parent
49917404
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
StageBucketTke.groovy
src/org/qg/docker_new/StageBucketTke.groovy
+15
-14
No files found.
src/org/qg/docker_new/StageBucketTke.groovy
View file @
6464715c
...
...
@@ -76,7 +76,7 @@ def project_attr(systemName) {
return
res_json
}
def
update_microservice
(
namespace
,
name
,
image
,
tier
)
{
def
update_microservice
(
namespace
,
name
,
image
,
tier
,
domain
)
{
dest_url
=
"http://172.30.220.22:3003/k8s/service/modifyImage"
response
=
httpRequest
httpMode:
"POST"
,
...
...
@@ -87,7 +87,8 @@ def update_microservice(namespace, name, image, tier) {
"serviceName":"${name}",
"image":"${image}",
"label":"${tier}",
"type":"${tier}"
"type":"${tier}",
domain:'${domain}'
}"""
,
url:
dest_url
...
...
@@ -554,23 +555,23 @@ def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,
def
deploy
(
namespace
,
systemName
,
imageTag
,
tier
,
isDeploy
)
{
stage
(
'Deploy To K8s Cluster'
){
imageTag
=
imageTag
.
replaceAll
(
"ccr.ccs.tencentyun.com/"
,
""
)
_utils
().
beautyEcho
(
"Deploy To K8s Cluster image: ${imageTag} to:${namespace}"
,
"info"
)
def
deploy_job_info
if
(
isDeploy
==
"true"
)
{
_utils
().
beautyEcho
(
"[新集群][deployV2]将镜像更新到到Namespace:"
+
namespace
,
"info
"
)
update_microservice
(
namespace
,
systemName
,
imageTag
,
tier
)
}
else
{
_utils
().
beautyEcho
(
"isDeploy == false,不执行deploy"
,
"info"
)
}
_utils
().
beautyEcho
(
"Deploy To K8S Cluster image: ${imageTag} to:${namespace}"
,
"info"
)
if
(
isDeploy
==
"true"
)
{
def
projectAttr
=
project_attr
(
systemName
)
def
host
=
projectAttr
[
"host"
].
split
(
"."
)[
0
]
imageTag
=
imageTag
.
replaceAll
(
"ccr.ccs.tencentyun.com/"
,
"
"
)
_utils
().
beautyEcho
(
"[新集群][deployV2]将镜像更新到到Namespace:"
+
namespace
,
"info"
)
update_microservice
(
namespace
,
systemName
,
imageTag
,
tier
,
host
)
}
else
{
_utils
().
beautyEcho
(
"isDeploy == false,不执行deploy"
,
"info"
)
}
}
}
def
clean_images
(
imageTag
,
imageTagCode
,
contextDir
)
{
//
sh "rm -rf ${contextDir}"
sh
"rm -rf ${contextDir}"
if
(
imageTag
){
sh
"docker rmi -f \$(docker images -q ${imageTag})"
sh
"docker rmi -f \$(docker images -q ${imageTagCode})"
...
...
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