Commit 5a551e39 authored by daidekun's avatar daidekun

clean

parent f38b6eec
......@@ -104,11 +104,15 @@ def deploy(namespace, systemName, imageTag, tier, isDeploy) {
}
}
def clean(contextDir, imageTag) {
def clean_images(imageTag) {
sh "docker rmi -f \$(docker images -q ${imageTag})"
}
def clean_dir(contextDir) {
sh "rm -rf ${contextDir}"
}
......@@ -29,6 +29,14 @@ def call(body) {
node {
try {
stage('Clean') {
_stage.clean_dir(contextDir)
}
stage('Checkout') {
_stage.checkout(branchName, gitRepo)
}
stage('prepare') {
deleteDir()
echo "buildType is: ${config.buildType}"
......@@ -52,10 +60,6 @@ def call(body) {
}
}
stage('Checkout') {
_stage.checkout(branchName, gitRepo)
}
stage('Build') {
switch (config.buildType) {
case "java":
......@@ -88,11 +92,11 @@ def call(body) {
}
stage("Clean") {
_stage.clean(contextDir, imageTag)
_stage.clean_images(imageTag)
}
} catch (err) {
if (imageTag) {
_stage.clean(contextDir, imageTag)
_stage.clean_images(imageTag)
}
currentBuild.result = 'FAILED'
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