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

fix

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