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
25ecbb0f
Commit
25ecbb0f
authored
Jan 18, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
fe172d5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
StageBucketTke.groovy
src/org/qg/docker_new/StageBucketTke.groovy
+14
-18
qgDockerPiplineWithDockerSlaveTke.groovy
vars/qgDockerPiplineWithDockerSlaveTke.groovy
+2
-2
No files found.
src/org/qg/docker_new/StageBucketTke.groovy
View file @
25ecbb0f
...
...
@@ -18,12 +18,12 @@ def contextMkdir(key) {
return
contextDir
}
def
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
tagName
,
imageType
){
def
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
tagName
){
def
imageTag4_4
=[:]
imageTag4_4
[
"harborHost"
]=
"http://192.168.4.4"
imageTag4_4
[
"imageTag"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
imageTag4_4
[
"imageTagCode"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
// if
(imageType
=="test"){
// if=="test"){
// imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tke${safeBranchName}-${tagName}"
// }else{
// imageTag4_4["imageTag"] = "192.168.4.4/${harborGroup}/${k8sSystemName}:tkeCode${safeBranchName}-${tagName}"
...
...
@@ -184,7 +184,7 @@ def getDocketPackageImage(buildType,buildEnv){
return
packageImageInfo
}
def
check_and_build
(
buildType
,
systemName
,
branchName
,
contextDir
,
imageType
){
def
check_and_build
(
buildType
,
systemName
,
branchName
,
contextDir
){
def
branchHashCode
=
null
...
...
@@ -209,17 +209,17 @@ def check_and_build(buildType,systemName,branchName,contextDir,imageType){
def
pacegeDockerInfo
=
getDocketPackageImage
(
buildType
,
buildEnv
)
if
(
buildType
in
[
"nodejs"
,
"lua-ui"
]){
branchHashCode
=
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
,
imageType
)
branchHashCode
=
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
)
}
else
{
docker
.
image
(
pacegeDockerInfo
[
"image"
]).
inside
(
pacegeDockerInfo
[
"args"
]){
branchHashCode
=
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
,
imageType
)
branchHashCode
=
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
)
}
}
return
branchHashCode
}
def
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
,
imageType
){
def
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
){
/*checkout code*/
stage
(
'Checkout'
)
{
...
...
@@ -230,7 +230,7 @@ def cpb(buildType,systemName,branchName,contextDir,imageType){
if
(
systemName
==
'xjd-ui'
&&
branchName
==
'apollo'
){
_utils
().
beautyEcho
(
"xjd-ui : apollo not exec prepare_config"
,
"info"
)
}
else
{
prepare_config
(
buildType
,
systemName
,
contextDir
,
imageType
)
prepare_config
(
buildType
,
systemName
,
contextDir
)
}
}
...
...
@@ -382,20 +382,20 @@ def checkout_luaui(systemName, branchName) {
}
}
def
prepare_config
(
buildType
,
systemName
,
contextDir
,
imageType
)
{
def
prepare_config
(
buildType
,
systemName
,
contextDir
)
{
_utils
().
beautyEcho
(
"Prepare Config +++ type:${buildType} systemName:${systemName}"
,
"info"
)
switch
(
buildType
)
{
case
"java"
:
prepare_java
(
systemName
,
contextDir
,
imageType
)
prepare_java
(
systemName
,
contextDir
)
break
case
"nodejs"
:
prepare_nodejs
(
systemName
,
contextDir
,
imageType
)
prepare_nodejs
(
systemName
,
contextDir
)
break
case
"python"
:
prepare_python
(
systemName
,
contextDir
,
imageType
)
prepare_python
(
systemName
,
contextDir
)
break
case
"lua-ui"
:
prepare_luaui
(
systemName
,
contextDir
,
imageType
)
prepare_luaui
(
systemName
,
contextDir
)
break
default:
_utils
().
beautyEcho
(
"未知的buildType: ${buildType}"
,
"fail"
)
...
...
@@ -403,12 +403,8 @@ def prepare_config(buildType,systemName, contextDir,imageType) {
}
}
def
prepare_java
(
systemName
,
contextDir
,
imageType
)
{
if
(
imageType
==
"test"
)
{
sh
"cp -rf /home/quant_group/qg-dockerfiles/tke/java/* ${contextDir}"
}
else
{
sh
"cp -rf /home/quant_group/qg-dockerfiles/prod/java/* ${contextDir}"
}
def
prepare_java
(
systemName
,
contextDir
)
{
sh
"cp -rf /home/quant_group/qg-dockerfiles/tke/java/* ${contextDir}"
def
existProperties
=
fileExists
"/home/quant_group/config_repository/java/${systemName}.properties"
...
...
vars/qgDockerPiplineWithDockerSlaveTke.groovy
View file @
25ecbb0f
...
...
@@ -62,7 +62,7 @@ def call(body) {
_utils
.
beautyEcho
(
"checkout & build < ${originSystemName} : ${originBranchName} >"
,
"stage"
)
for
(
def
i
=
0
;
i
<
systemNames
.
length
;
i
++){
dir
(
systemNames
[
i
]){
branchHashCode
=
_stage
.
check_and_build
(
config
.
buildType
,
systemNames
[
i
],
branchNames
[
i
],
contextDir
,
imageType
)
branchHashCode
=
_stage
.
check_and_build
(
config
.
buildType
,
systemNames
[
i
],
branchNames
[
i
],
contextDir
)
}
}
_utils
.
beautyEcho
(
"build over"
,
"info"
)
...
...
@@ -76,7 +76,7 @@ def call(body) {
def
k8sSystemName
=
originSystemName
.
replaceAll
(
"_"
,
"-"
).
toLowerCase
()
def
safeBranchName
=
originBranchName
.
replaceAll
(
regex
,
"_"
).
toLowerCase
()
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
,
imageType
)
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
for
(
imageTagInfo
in
imageTagInfos
){
_stage
.
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
originSystemName
,
originBranchName
,
cluster
,
timeStemp
,
contextDir
,
branchHashCode
)
...
...
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