Fix cleanup workspace bug for jenkins ci (#6780)

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/6783/head
quicksilver 2021-07-23 20:11:34 +08:00 committed by GitHub
parent 21bc5810c0
commit c633e579a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 9 deletions

View File

@ -86,6 +86,20 @@ pipeline {
}
}
post {
always {
container('main') {
script {
sh "./tests/scripts/export_logs.sh"
dir("${env.ARTIFACTS}") {
sh "find ./kind -path '*/history/*' -type f | xargs tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${SEMVER}-${env.BUILD_NUMBER}-${MILVUS_CLIENT}-e2e-logs.tar.gz --transform='s:^[^/]*/[^/]*/[^/]*/[^/]*/::g' || true"
if ("${MILVUS_CLIENT}" == "pymilvus-orm") {
sh "tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${MILVUS_CLIENT}-pytest-logs.tar.gz ./tests/pytest_logs --remove-files || true"
}
archiveArtifacts artifacts: "**.tar.gz", allowEmptyArchive: true
}
}
}
}
unsuccessful {
container('jnlp') {
script {
@ -101,14 +115,6 @@ pipeline {
cleanup {
container('main') {
script {
sh "./tests/scripts/export_logs.sh"
dir("${env.ARTIFACTS}") {
sh "find ./kind -path '*/history/*' -type f | xargs tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${SEMVER}-${env.BUILD_NUMBER}-${MILVUS_CLIENT}-e2e-logs.tar.gz --transform='s:^[^/]*/[^/]*/[^/]*/[^/]*/::g' || true"
if ("${MILVUS_CLIENT}" == "pymilvus-orm") {
sh "tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${MILVUS_CLIENT}-pytest-logs.tar.gz ./tests/pytest_logs --remove-files || true"
}
archiveArtifacts artifacts: "**.tar.gz", allowEmptyArchive: true
}
sh "kind delete cluster --name kind -v9 || true"
sh 'find . -name . -o -prune -exec rm -rf -- {} +' /* clean up our workspace */
}

View File

@ -123,7 +123,7 @@ pipeline {
}
}
}
cleanup {
always {
container('main') {
script {
sh "./tests/scripts/export_logs.sh"
@ -134,6 +134,12 @@ pipeline {
}
archiveArtifacts artifacts: "**.tar.gz", allowEmptyArchive: true
}
}
}
}
cleanup {
container('main') {
script {
sh "kind delete cluster --name kind -v9 || true"
sh 'find . -name . -o -prune -exec rm -rf -- {} +' /* clean up our workspace */
}