Commit 715cf42d authored by kalvin's avatar kalvin

imageTag

parent 1367c344
......@@ -366,6 +366,23 @@ def update_microservice(namespace, name, image, tier) {
return res_json
}
def set_image_info(microservice_name, git_commit_hash, image) {
dest_url = "http://eos.quantgroups.com/api/etcd/set_image_info"
response = httpRequest httpMode:"POST",
consoleLogResponseBody:true,
contentType:"APPLICATION_JSON",
requestBody:"""{
"microservice_name":"${name}",
"git_commit_hash":"${name}",
"image": "${image}"
}""",
url:dest_url
def res_json = jsonParse(response.content)
return res_json
}
def slaveImageRespority(buildEnv){
//envType java8 java9 node7 node8
......@@ -495,7 +512,7 @@ def cpb(buildType,systemName,branchName,contextDir){
}
def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,timeStemp,contextDir){
def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,timeStemp,contextDir,branchHashCode){
//systemName == originSystemName
def harbor_host = imageTagInfo["harborHost"]
def imageTag = imageTagInfo["imageTag"]
......@@ -519,14 +536,13 @@ def dockerbuild_and_push(imageTagInfo,buildNumber,systemName,branchName,cluster,
}
_utils().beautyEcho("镜像地址:${imageTag}", "info")
}
}
/* 设置etcd镜像信息 */
set_image_info(systemName, branchHashCode, imageTag)
}
def deploy(namespace, systemName, imageTag, tier, isDeploy) {
stage('Deploy To K8s Cluster'){
_utils().beautyEcho("Deploy To K8s Cluster image: ${imageTag} to:${namespace}", "info")
def deploy_job_info
......
......@@ -83,7 +83,7 @@ def call(body) {
imageTagInfos = _stage.imageTag(harborGroup,k8sSystemName,safeBranchName,branchHashCode)
for (imageTagInfo in imageTagInfos){
_stage.dockerbuild_and_push(imageTagInfo,buildNumber,_systemName,originBranchName ,cluster,timeStemp,contextDir)
_stage.dockerbuild_and_push(imageTagInfo,buildNumber,_systemName,originBranchName ,cluster,timeStemp,contextDir,branchHashCode)
}
_stage.deploy(namespace, _systemName, imageTagInfos[0]["imageTag"], 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