Cleanup workspace after jenkins ci build (#5850)

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/5867/head
quicksilver 2021-06-18 11:56:05 +08:00 committed by GitHub
parent 676a30e418
commit 5b85bda30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -6,7 +6,10 @@ pipeline {
timestamps()
timeout(time: 30, unit: 'MINUTES')
buildDiscarder logRotator(artifactDaysToKeepStr: '30')
// This is required if you want to clean before build
skipDefaultCheckout(true)
// parallelsAlwaysFailFast()
}
stages {
stage ('E2E Test') {
@ -33,6 +36,7 @@ pipeline {
SEMVER = "${BRANCH_NAME.contains('/') ? BRANCH_NAME.substring(BRANCH_NAME.lastIndexOf('/') + 1) : BRANCH_NAME}"
IMAGE_REPO = "dockerhub-mirror-sh.zilliz.cc/milvusdb"
DOCKER_BUILDKIT = 1
CUSTOM_THIRDPARTY_PATH = "/tmp/third_party"
ARTIFACTS = "${env.WORKSPACE}/artifacts"
}
stages {
@ -76,6 +80,11 @@ pipeline {
sh 'docker rm -f \$(docker network inspect -f \'{{ range \$key, \$value := .Containers }}{{ printf "%s " \$key}}{{ end }}\' kind) || true'
sh 'docker network rm kind 2>&1 > /dev/null || true'
}
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE']])
}
}
}

View File

@ -15,6 +15,8 @@ pipeline {
timestamps()
timeout(time: 1, unit: 'HOURS')
buildDiscarder logRotator(artifactDaysToKeepStr: '30')
// This is required if you want to clean before build
skipDefaultCheckout(true)
// parallelsAlwaysFailFast()
}
stages {
@ -40,6 +42,7 @@ pipeline {
SEMVER = "${BRANCH_NAME.contains('/') ? BRANCH_NAME.substring(BRANCH_NAME.lastIndexOf('/') + 1) : BRANCH_NAME}"
IMAGE_REPO = "dockerhub-mirror-sh.zilliz.cc/milvusdb"
DOCKER_BUILDKIT = 1
CUSTOM_THIRDPARTY_PATH = "/tmp/third_party"
ARTIFACTS = "${env.WORKSPACE}/artifacts"
DOCKER_CREDENTIALS_ID = "ba070c98-c8cc-4f7c-b657-897715f359fc"
DOKCER_REGISTRY_URL = "registry.zilliz.com"
@ -99,6 +102,11 @@ pipeline {
sh 'docker rm -f \$(docker network inspect -f \'{{ range \$key, \$value := .Containers }}{{ printf "%s " \$key}}{{ end }}\' kind) || true'
sh 'docker network rm kind 2>&1 > /dev/null || true'
}
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE']])
}
}
}

View File

@ -16,6 +16,8 @@ pipeline {
options {
timestamps()
timeout(time: 30, unit: 'MINUTES')
// This is required if you want to clean before build
skipDefaultCheckout(true)
// parallelsAlwaysFailFast()
}
@ -53,4 +55,17 @@ pipeline {
}
}
}
post {
always {
container('main') {
script {
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE']])
}
}
}
}
}