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
5d90a3bf
Commit
5d90a3bf
authored
Apr 09, 2018
by
wentao.suo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffff
parent
2c309533
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
StageBucket.groovy
src/org/qg/docker_new/StageBucket.groovy
+19
-0
qgDockerPiplineWithDockerSlave.groovy
vars/qgDockerPiplineWithDockerSlave.groovy
+1
-14
No files found.
src/org/qg/docker_new/StageBucket.groovy
View file @
5d90a3bf
...
...
@@ -369,3 +369,22 @@ def checkAndBuild(buildType,systemName,branchName,contextDir){
}
}
def
dockerMake
(
buildNumber
,
systemName
,
branchName
,
cluster
,
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
){
imageTag
=
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
withDockerRegistry
([
credentialsId:
'harbor-qajenkins'
,
url:
"http://192.168.4.36"
])
{
def
build_schema
=
"BUILD_TIME:${timeStemp}@BUILD_NUMBER:${buildNumber}@SYSTEM_NAME:${systemName}@BRANCH_NAME:${branchName}@CLUSTER:${cluster}"
echo
build_schema
def
image
=
docker
.
build
(
imageTag
,
"--build-arg BUILD_SCHEMA=${build_schema} ${contextDir}"
)
image
.
push
()
if
(
branchName
==
"master"
||
branchName
==
"master--master"
)
{
image
.
push
(
'latest'
)
}
}
}
vars/qgDockerPiplineWithDockerSlave.groovy
View file @
5d90a3bf
...
...
@@ -65,20 +65,7 @@ def call(body) {
_utils
.
beautyEcho
(
"build over"
,
"info"
)
stage
(
'make docker image'
)
{
_utils
.
beautyEcho
(
"make docker image"
,
"stage"
)
imageTag
=
_stage
.
imageTag
(
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
withDockerRegistry
([
credentialsId:
'harbor-qajenkins'
,
url:
"http://192.168.4.36"
])
{
def
build_schema
=
"BUILD_TIME:${timeStemp}@BUILD_NUMBER:${buildNumber}@SYSTEM_NAME:${systemName}@BRANCH_NAME:${branchName}@CLUSTER:${cluster}"
echo
build_schema
def
image
=
docker
.
build
(
imageTag
,
"--build-arg BUILD_SCHEMA=${build_schema} ${contextDir}"
)
image
.
push
()
if
(
branchName
==
"master"
||
branchName
==
"master--master"
)
{
image
.
push
(
'latest'
)
}
}
_stage
.
dockerMake
(
buildNumber
,
systemName
,
branchName
,
cluster
,
harborGroup
,
k8sSystemName
,
safeBranchName
,
timeStemp
)
}
...
...
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