Commit 30776b1b authored by wentao.suo's avatar wentao.suo

fix

parent 6cdec855
......@@ -460,10 +460,12 @@ def deploy(namespace, systemName, imageTag, tier, isDeploy) {
return imageTag
}*/
def clean_images(imageTag,contextDir) {
def clean_images(imageTags,contextDir) {
sh "rm -rf ${contextDir}"
for (imageTag in imageTags){}
if (imageTag){
sh "docker rmi -f \$(docker images -q ${imageTag})"
}
}
}
......@@ -30,7 +30,7 @@ def call(body) {
def branchNames = originBranchName.split("--")
def contextDir
def imageTag
def imageTags
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
......@@ -90,12 +90,12 @@ def call(body) {
/* 4 */
stage('Clean'){
_utils.beautyEcho("Clear Cache Tmp", "stage")
_stage.clean_images(imageTag,contextDir)
_stage.clean_images(imageTags,contextDir)
}
} catch (err) {
_utils.beautyEcho(err, "fail")
_stage.clean_images(imageTag,contextDir)
_stage.clean_images(imageTags,contextDir)
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