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
715cf42d
Commit
715cf42d
authored
May 16, 2018
by
kalvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imageTag
parent
1367c344
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
StageBucket.groovy
src/org/qg/docker_new/StageBucket.groovy
+20
-4
qgDockerPiplineWithDockerSlave.groovy
vars/qgDockerPiplineWithDockerSlave.groovy
+1
-1
No files found.
src/org/qg/docker_new/StageBucket.groovy
View file @
715cf42d
...
@@ -366,6 +366,23 @@ def update_microservice(namespace, name, image, tier) {
...
@@ -366,6 +366,23 @@ def update_microservice(namespace, name, image, tier) {
return
res_json
return
res_json
}
}
def
set_image_info
(
microservice_name
,
git_commit_hash
,
image
)
{
dest_url
=
"http://eos.quantgroups.com/api/etcd/set_image_info"
response
=
httpRequest
httpMode:
"POST"
,
consoleLogResponseBody:
true
,
contentType:
"APPLICATION_JSON"
,
requestBody:
"""{
"microservice_name":"${name}",
"git_commit_hash":"${name}",
"image": "${image}"
}"""
,
url:
dest_url
def
res_json
=
jsonParse
(
response
.
content
)
return
res_json
}
def
slaveImageRespority
(
buildEnv
){
def
slaveImageRespority
(
buildEnv
){
//envType java8 java9 node7 node8
//envType java8 java9 node7 node8
...
@@ -495,7 +512,7 @@ def cpb(buildType,systemName,branchName,contextDir){
...
@@ -495,7 +512,7 @@ def cpb(buildType,systemName,branchName,contextDir){
}
}
def
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
systemName
,
branchName
,
cluster
,
timeStemp
,
contextDir
){
def
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
systemName
,
branchName
,
cluster
,
timeStemp
,
contextDir
,
branchHashCode
){
//systemName == originSystemName
//systemName == originSystemName
def
harbor_host
=
imageTagInfo
[
"harborHost"
]
def
harbor_host
=
imageTagInfo
[
"harborHost"
]
def
imageTag
=
imageTagInfo
[
"imageTag"
]
def
imageTag
=
imageTagInfo
[
"imageTag"
]
...
@@ -519,14 +536,13 @@ def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,
...
@@ -519,14 +536,13 @@ def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,
}
}
_utils
().
beautyEcho
(
"镜像地址:${imageTag}"
,
"info"
)
_utils
().
beautyEcho
(
"镜像地址:${imageTag}"
,
"info"
)
}
}
}
}
/* 设置etcd镜像信息 */
set_image_info
(
systemName
,
branchHashCode
,
imageTag
)
}
}
def
deploy
(
namespace
,
systemName
,
imageTag
,
tier
,
isDeploy
)
{
def
deploy
(
namespace
,
systemName
,
imageTag
,
tier
,
isDeploy
)
{
stage
(
'Deploy To K8s Cluster'
){
stage
(
'Deploy To K8s Cluster'
){
_utils
().
beautyEcho
(
"Deploy To K8s Cluster image: ${imageTag} to:${namespace}"
,
"info"
)
_utils
().
beautyEcho
(
"Deploy To K8s Cluster image: ${imageTag} to:${namespace}"
,
"info"
)
def
deploy_job_info
def
deploy_job_info
...
...
vars/qgDockerPiplineWithDockerSlave.groovy
View file @
715cf42d
...
@@ -83,7 +83,7 @@ def call(body) {
...
@@ -83,7 +83,7 @@ def call(body) {
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
branchHashCode
)
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
branchHashCode
)
for
(
imageTagInfo
in
imageTagInfos
){
for
(
imageTagInfo
in
imageTagInfos
){
_stage
.
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
_systemName
,
originBranchName
,
cluster
,
timeStemp
,
contextDir
)
_stage
.
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
_systemName
,
originBranchName
,
cluster
,
timeStemp
,
contextDir
,
branchHashCode
)
}
}
_stage
.
deploy
(
namespace
,
_systemName
,
imageTagInfos
[
0
][
"imageTag"
],
config
.
tier
,
isDeploy
)
_stage
.
deploy
(
namespace
,
_systemName
,
imageTagInfos
[
0
][
"imageTag"
],
config
.
tier
,
isDeploy
)
...
...
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