Commit 6cdec855 authored by wentao.suo's avatar wentao.suo

add two harbor

parent 1b5f00d4
......@@ -19,7 +19,10 @@ def contextMkdir(key) {
}
def imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp){
return "192.168.4.4/${harborGroup}/${k8sSystemName}:${safeBranchName}-${timeStemp}"
return [
"192.168.4.3/${harborGroup}/${k8sSystemName}:${safeBranchName}-${timeStemp}",
"192.168.4.4/${harborGroup}/${k8sSystemName}:${safeBranchName}-${timeStemp}"
]
}
def init_dependency() {
......
......@@ -69,17 +69,20 @@ def call(body) {
/* 3 */
withDockerServer([uri: "tcp://192.168.4.96:2375/"]) {
_utils.beautyEcho("make docker image", "stage")
def _systemName = originSystemName.toLowerCase()
def regex = "[`,./;\\[\\]&<>?:\"()|-]+"
def k8sSystemName = originSystemName.replaceAll("_","-")
def safeBranchName = originBranchName.replaceAll(regex,"_")
imageTag = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp)
imageTags = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,timeStemp)
for (imageTag in imageTags){
def _systemName = originSystemName.toLowerCase()
_stage.dockerbuild_and_push(imageTag,buildNumber,_systemName,originBranchName ,cluster,timeStemp,contextDir)
_utils.beautyEcho("Deploy To K8s Cluster image: ${imageTag} to:${namespace}", "stage")
_stage.deploy(namespace, _systemName, imageTag, config.tier, isDeploy)
}
_stage.deploy(namespace, _systemName, imageTag[0], config.tier, isDeploy)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment