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
a5f076eb
Commit
a5f076eb
authored
Mar 29, 2018
by
kalvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除cluster
parent
1d9ab8d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
StageBucket.groovy
src/org/qg/docker/StageBucket.groovy
+6
-6
qgDockerPipeline.groovy
vars/qgDockerPipeline.groovy
+3
-7
No files found.
src/org/qg/docker/StageBucket.groovy
View file @
a5f076eb
...
@@ -222,7 +222,7 @@ def build_luaui(namespace, systemNames, contextDir) {
...
@@ -222,7 +222,7 @@ def build_luaui(namespace, systemNames, contextDir) {
}
}
}
}
def
dockerbuild_and_push
(
timeNow
,
buildNumber
,
branchName
,
harborGroup
,
systemName
,
contextDir
,
cluster
)
{
def
dockerbuild_and_push
(
timeNow
,
buildNumber
,
branchName
,
harborGroup
,
systemName
,
contextDir
)
{
regex
=
"[`,./;\\[\\]&<>?:\"()|-]+"
regex
=
"[`,./;\\[\\]&<>?:\"()|-]+"
k8sSystemName
=
systemName
.
replaceAll
(
"_"
,
"-"
)
k8sSystemName
=
systemName
.
replaceAll
(
"_"
,
"-"
)
...
@@ -234,7 +234,7 @@ def dockerbuild_and_push(timeNow, buildNumber, branchName, harborGroup, systemNa
...
@@ -234,7 +234,7 @@ def dockerbuild_and_push(timeNow, buildNumber, branchName, harborGroup, systemNa
withDockerServer
([
uri:
"tcp://192.168.4.96:2375/"
])
{
withDockerServer
([
uri:
"tcp://192.168.4.96:2375/"
])
{
withDockerRegistry
([
credentialsId:
'harbor-qajenkins'
,
url:
"http://192.168.4.36"
])
{
withDockerRegistry
([
credentialsId:
'harbor-qajenkins'
,
url:
"http://192.168.4.36"
])
{
def
image
=
docker
.
build
(
imageTag
,
"--build-arg
CLUSTER=${cluster}
--build-arg BUILD_TIME=${timeNow} --build-arg BUILD_NUMBER=${buildNumber} --build-arg SYSTEM_NAME=${systemName} --build-arg BRANCH_NAME=${branchName} --build-arg SAFE_SYSTEM_NAME=${defaultSystemName} ${contextDir}"
)
def
image
=
docker
.
build
(
imageTag
,
"--build-arg --build-arg BUILD_TIME=${timeNow} --build-arg BUILD_NUMBER=${buildNumber} --build-arg SYSTEM_NAME=${systemName} --build-arg BRANCH_NAME=${branchName} --build-arg SAFE_SYSTEM_NAME=${defaultSystemName} ${contextDir}"
)
image
.
push
()
image
.
push
()
if
(
branchName
==
"master"
||
branchName
==
"master--master"
)
{
if
(
branchName
==
"master"
||
branchName
==
"master--master"
)
{
...
@@ -248,9 +248,9 @@ def dockerbuild_and_push(timeNow, buildNumber, branchName, harborGroup, systemNa
...
@@ -248,9 +248,9 @@ def dockerbuild_and_push(timeNow, buildNumber, branchName, harborGroup, systemNa
return
imageTag
return
imageTag
}
}
def
deploy
(
namespace
,
systemName
,
imageTag
,
tier
,
isDeploy
)
{
/*
def deploy(namespace, systemName, imageTag, tier, isDeploy) {
def deploy_job_info
def deploy_job_info
if (isDeploy=="true") {
if (isDeploy=="true") {
_utils().beautyEcho("[旧集群][deploy]将镜像更新到到Namespace:" + namespace, "info")
_utils().beautyEcho("[旧集群][deploy]将镜像更新到到Namespace:" + namespace, "info")
deploy_job_info = build job: '3.deployer.Updater', parameters: [
deploy_job_info = build job: '3.deployer.Updater', parameters: [
...
@@ -258,13 +258,13 @@ def deploy(namespace, systemName, imageTag, tier, isDeploy) {
...
@@ -258,13 +258,13 @@ def deploy(namespace, systemName, imageTag, tier, isDeploy) {
string(name:'name', value: "${systemName}"),
string(name:'name', value: "${systemName}"),
string(name:'image', value: "${imageTag}"),
string(name:'image', value: "${imageTag}"),
string(name:'tier', value: "${tier}")]
string(name:'tier', value: "${tier}")]
log = Jenkins.getInstance().getItemByFullName('3.deployer.Updater').getBuildByNumber(deploy_job_info.getNumber()).logFile.text
log = Jenkins.getInstance().getItemByFullName('3.deployer.Updater').getBuildByNumber(deploy_job_info.getNumber()).logFile.text
return log
return log
}else{
}else{
_utils().beautyEcho("namespace:[${namespace}]不存在,不执行deploy", "info")
_utils().beautyEcho("namespace:[${namespace}]不存在,不执行deploy", "info")
}
}
}
}
*/
def
deployV2
(
namespace
,
systemName
,
imageTag
,
tier
,
isDeploy
)
{
def
deployV2
(
namespace
,
systemName
,
imageTag
,
tier
,
isDeploy
)
{
def
deploy_job_info
def
deploy_job_info
...
...
vars/qgDockerPipeline.groovy
View file @
a5f076eb
...
@@ -16,7 +16,6 @@ def call(body) {
...
@@ -16,7 +16,6 @@ def call(body) {
def
namespace
=
env
.
NAMESPACE
def
namespace
=
env
.
NAMESPACE
def
isDeploy
=
env
.
IS_DEPLOY
def
isDeploy
=
env
.
IS_DEPLOY
def
buildNumber
=
env
.
BUILD_NUMBER
def
buildNumber
=
env
.
BUILD_NUMBER
def
cluster
=
env
.
CLUSTER
t
=
gitRepo
.
split
(
"/"
)
t
=
gitRepo
.
split
(
"/"
)
def
gitGroup
=
t
[
0
]
def
gitGroup
=
t
[
0
]
...
@@ -111,18 +110,15 @@ def call(body) {
...
@@ -111,18 +110,15 @@ def call(body) {
_stage
.
copy_files_java
(
systemName
,
contextDir
)
_stage
.
copy_files_java
(
systemName
,
contextDir
)
}
}
imageTag
=
_stage
.
dockerbuild_and_push
(
timeNow
,
buildNumber
,
branchName
,
harborGroup
,
systemName
,
contextDir
,
cluster
)
imageTag
=
_stage
.
dockerbuild_and_push
(
timeNow
,
buildNumber
,
branchName
,
harborGroup
,
systemName
,
contextDir
)
}
}
stage
(
'Deploy To K8s Cluster'
)
{
stage
(
'Deploy To K8s Cluster'
)
{
_utils
.
beautyEcho
(
"Deploy To K8s Cluster"
,
"stage"
)
_utils
.
beautyEcho
(
"Deploy To K8s Cluster"
,
"stage"
)
def
deploy_log
def
deploy_log
if
(
config
.
cluster
==
"271"
)
{
deploy_log
=
_stage
.
deployV2
(
namespace
,
systemName
,
imageTag
,
config
.
tier
,
isDeploy
)
deploy_log
=
_stage
.
deployV2
(
namespace
,
systemName
,
imageTag
,
config
.
tier
,
isDeploy
)
}
else
{
deploy_log
=
_stage
.
deploy
(
namespace
,
systemName
,
imageTag
,
config
.
tier
,
isDeploy
)
}
_utils
.
beautyEcho
(
deploy_log
,
"info"
)
_utils
.
beautyEcho
(
deploy_log
,
"info"
)
}
}
...
...
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