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
08533aa3
Commit
08533aa3
authored
Apr 26, 2018
by
wentao.suo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
85982c36
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
StageBucket.groovy
src/org/qg/docker_new/StageBucket.groovy
+18
-8
qgDockerPiplineWithDockerSlave.groovy
vars/qgDockerPiplineWithDockerSlave.groovy
+4
-3
No files found.
src/org/qg/docker_new/StageBucket.groovy
View file @
08533aa3
...
...
@@ -18,12 +18,12 @@ def contextMkdir(key) {
return
contextDir
}
def
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
t
imeStemp
){
def
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
t
agName
){
def
imageTag4_4
=[:]
/* def branchHash = sh (script: 'git log -1 --pretty=%H',returnStdout: true).trim()*/
imageTag4_4
[
"harborHost"
]=
"http://192.168.4.4"
imageTag4_4
[
"imageTag"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:${safeBranchName}-${t
imeStemp
}"
imageTag4_4
[
"imageTag"
]
=
"192.168.4.4/${harborGroup}/${k8sSystemName}:${safeBranchName}-${t
agName
}"
return
[
imageTag4_4
]
}
...
...
@@ -114,6 +114,11 @@ def checkout(buildType,systemName, branchName) {
echo
"未知的buildType: ${cbuildType}"
break
}
def
brahHashCode
=
sh
(
script:
'git log -1 --pretty=%H'
,
returnStdout:
true
).
trim
()
return
brahHashCode
}
def
checkout_java
(
systemName
,
branchName
)
{
...
...
@@ -407,7 +412,7 @@ def getDocketPackageImage(buildType,buildEnv){
def
check_and_build
(
buildType
,
systemName
,
branchName
,
contextDir
){
def
branchHashCode
=
null
def
buildEnv
=
""
switch
(
buildType
){
...
...
@@ -432,20 +437,23 @@ def check_and_build(buildType,systemName,branchName,contextDir){
if
(
buildType
in
[
"nodejs"
,
"lua-ui"
]){
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
)
return
branchHashCode
=
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
)
}
else
{
docker
.
image
(
pacegeDockerInfo
[
"image"
]).
inside
(
pacegeDockerInfo
[
"args"
]){
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
)
branchHashCode
=
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
)
}
}
return
branchHashCode
}
def
cpb
(
buildType
,
systemName
,
branchName
,
contextDir
){
/*checkout code*/
stage
(
'Checkout'
)
{
checkout
(
buildType
,
systemName
,
branchName
)
branchHashCode
=
checkout
(
buildType
,
systemName
,
branchName
)
}
/*prepare config*/
stage
(
'Prepare'
)
{
...
...
@@ -456,6 +464,8 @@ def cpb(buildType,systemName,branchName,contextDir){
build
(
buildType
,
systemName
,
contextDir
)
}
return
branchHashCode
}
def
dockerbuild_and_push
(
imageTagInfo
,
buildNumber
,
systemName
,
branchName
,
cluster
,
timeStemp
,
contextDir
){
...
...
vars/qgDockerPiplineWithDockerSlave.groovy
View file @
08533aa3
...
...
@@ -31,6 +31,7 @@ def call(body) {
def
contextDir
def
imageTagInfos
def
branchHashCode
body
.
resolveStrategy
=
Closure
.
DELEGATE_FIRST
body
.
delegate
=
config
...
...
@@ -59,7 +60,7 @@ def call(body) {
for
(
def
i
=
0
;
i
<
systemNames
.
length
;
i
++){
dir
(
systemNames
[
i
]){
_stage
.
check_and_build
(
config
.
buildType
,
systemNames
[
i
],
branchNames
[
i
],
contextDir
)
branchHashCode
=
_stage
.
check_and_build
(
config
.
buildType
,
systemNames
[
i
],
branchNames
[
i
],
contextDir
)
}
}
...
...
@@ -77,7 +78,7 @@ def call(body) {
def
regex
=
"[`,./;\\[\\]&<>?:\"()|-]+"
def
k8sSystemName
=
originSystemName
.
replaceAll
(
"_"
,
"-"
)
def
safeBranchName
=
originBranchName
.
replaceAll
(
regex
,
"_"
)
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
imageTagInfos
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
branchHashCode
)
for
(
imageTagInfo
in
imageTagInfos
){
...
...
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