Commit c78e6222 authored by 智勇's avatar 智勇

up

parent 73431243
......@@ -586,11 +586,17 @@ def deploy(namespace, systemName, imageTag, tier, isDeploy) {
}
def clean_images(imageTag,imageTagCode,contextDir) {
def clean_images(imageTag,imageTagCode,contextDir,buildType) {
sh "rm -rf ${contextDir}"
if(buildType=="java"){
if (cluster=="pro"){
sh "docker rmi -f \$(docker images -q ${imageTagCode})"
}else if (cluster=="test") {
sh "docker rmi -f \$(docker images -q ${imageTag})"
}
}else{
sh "docker rmi -f \$(docker images -q ${imageTagCode})"
sh "docker rmi -f \$(docker images -q ${imageTag})"
}
}
......@@ -87,12 +87,12 @@ def call(body) {
/* 4 */
stage('Clean'){
_utils.beautyEcho("Clear Cache Tmp", "stage")
_stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir)
_stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir,config.buildType)
}
} catch (err) {
_utils.beautyEcho(err, "fail")
if(imageTagInfos != null){
_stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir)
_stage.clean_images(imageTagInfos[0]["imageTag"],imageTagInfos[0]["imageTagCode"],contextDir,config.buildType)
}
throw err
}
......
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