提交 f47f695c 编写于 作者: J Jeff

Revert "format clean up stage"

This reverts commit f2eb4ca5 [formerly 29cd25f823901ecd46fd174fa26ddb57ef3c3620]

Former-commit-id: b25e2946b1463dec8690d0650c5e08f5db37ba49
上级 314a9179
try { try {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}"
if (currentBuild.result == 'ABORTED') {
throw new hudson.AbortException("Dev Test Aborted !")
} else if (currentBuild.result == 'FAILURE') {
error("Dev Test Failure !")
}
} catch (exc) { } catch (exc) {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}"
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed' updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
......
try { try {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster" sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster"
if (currentBuild.result == 'ABORTED') {
throw new hudson.AbortException("Cluster Dev Test Aborted !")
} else if (currentBuild.result == 'FAILURE') {
error("Dev Test Failure !")
}
} catch (exc) { } catch (exc) {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster" sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster"
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed' updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
......
...@@ -9,8 +9,8 @@ container('milvus-testframework') { ...@@ -9,8 +9,8 @@ container('milvus-testframework') {
} }
} catch (exc) { } catch (exc) {
updateGitlabCommitStatus name: 'Dev Test', state: 'failed' updateGitlabCommitStatus name: 'Dev Test', state: 'failed'
currentBuild.result = 'FAILURE'
echo 'Milvus Test Failed !' echo 'Milvus Test Failed !'
throw exc
} }
} }
} }
......
...@@ -9,8 +9,8 @@ container('milvus-testframework') { ...@@ -9,8 +9,8 @@ container('milvus-testframework') {
} }
} catch (exc) { } catch (exc) {
updateGitlabCommitStatus name: 'Dev Test', state: 'failed' updateGitlabCommitStatus name: 'Dev Test', state: 'failed'
currentBuild.result = 'FAILURE'
echo 'Milvus Test Failed !' echo 'Milvus Test Failed !'
throw exc
} }
} }
} }
......
...@@ -191,25 +191,41 @@ spec: ...@@ -191,25 +191,41 @@ spec:
} }
} }
} }
post { }
always {
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { agent {
kubernetes { kubernetes {
label 'jenkins-slave' label 'jenkins-slave'
defaultContainer 'jnlp' defaultContainer 'jnlp'
} }
} }
stages { stages {
gitlabCommitStatus(name: 'Cleanup Dev') { stage('Cleanup') {
script { steps {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy" gitlabCommitStatus(name: 'Cleanup Dev') {
} script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
} }
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled'
echo "Milvus Cleanup Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
}
}
} }
} }
} }
...@@ -274,25 +290,41 @@ spec: ...@@ -274,25 +290,41 @@ spec:
} }
} }
} }
post { }
always {
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { agent {
kubernetes { kubernetes {
label 'jenkins-slave' label 'jenkins-slave'
defaultContainer 'jnlp' defaultContainer 'jnlp'
} }
} }
stages { stages {
gitlabCommitStatus(name: 'Cleanup Dev') { stage('Cleanup') {
script { steps {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy" gitlabCommitStatus(name: 'Cleanup Dev') {
} script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
} }
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled'
echo "Milvus Cleanup Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
}
}
} }
} }
} }
...@@ -343,3 +375,4 @@ spec: ...@@ -343,3 +375,4 @@ spec:
} }
} }
} }
...@@ -191,25 +191,41 @@ spec: ...@@ -191,25 +191,41 @@ spec:
} }
} }
} }
post { }
always {
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { agent {
kubernetes { kubernetes {
label 'jenkins-slave' label 'jenkins-slave'
defaultContainer 'jnlp' defaultContainer 'jnlp'
} }
} }
stages { stages {
gitlabCommitStatus(name: 'Cleanup Dev') { stage('Cleanup') {
script { steps {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy" gitlabCommitStatus(name: 'Cleanup Dev') {
} script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
} }
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled'
echo "Milvus Cleanup Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
}
}
} }
} }
} }
...@@ -274,25 +290,41 @@ spec: ...@@ -274,25 +290,41 @@ spec:
} }
} }
} }
post { }
always {
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { agent {
kubernetes { kubernetes {
label 'jenkins-slave' label 'jenkins-slave'
defaultContainer 'jnlp' defaultContainer 'jnlp'
} }
} }
stages { stages {
gitlabCommitStatus(name: 'Cleanup Dev') { stage('Cleanup') {
script { steps {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy" gitlabCommitStatus(name: 'Cleanup Dev') {
} script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
} }
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled'
echo "Milvus Cleanup Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
}
}
} }
} }
} }
...@@ -305,18 +337,16 @@ spec: ...@@ -305,18 +337,16 @@ spec:
post { post {
always { always {
script { script {
if (env.gitlabAfter != null) { if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { // Send an email only if the build status has changed from green/unstable to red
// Send an email only if the build status has changed from green/unstable to red emailext subject: '$DEFAULT_SUBJECT',
emailext subject: '$DEFAULT_SUBJECT', body: '$DEFAULT_CONTENT',
body: '$DEFAULT_CONTENT', recipientProviders: [
recipientProviders: [ [$class: 'DevelopersRecipientProvider'],
[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']
[$class: 'RequesterRecipientProvider'] ],
], replyTo: '$DEFAULT_REPLYTO',
replyTo: '$DEFAULT_REPLYTO', to: '$DEFAULT_RECIPIENTS'
to: '$DEFAULT_RECIPIENTS'
}
} }
} }
} }
...@@ -343,3 +373,4 @@ spec: ...@@ -343,3 +373,4 @@ spec:
} }
} }
} }
...@@ -191,26 +191,41 @@ spec: ...@@ -191,26 +191,41 @@ spec:
} }
} }
} }
}
post { stage ("Cleanup Dev") {
always { agent {
stage ("Cleanup Dev") { kubernetes {
agent { label 'jenkins-slave'
kubernetes { defaultContainer 'jnlp'
label 'jenkins-slave' }
defaultContainer 'jnlp' }
} stages {
} stage('Cleanup') {
stages { steps {
gitlabCommitStatus(name: 'Cleanup Dev') { gitlabCommitStatus(name: 'Cleanup Dev') {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
} }
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled'
echo "Milvus Cleanup Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
}
}
} }
} }
} }
...@@ -275,25 +290,41 @@ spec: ...@@ -275,25 +290,41 @@ spec:
} }
} }
} }
post { }
always {
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { agent {
kubernetes { kubernetes {
label 'jenkins-slave' label 'jenkins-slave'
defaultContainer 'jnlp' defaultContainer 'jnlp'
} }
} }
stages { stages {
gitlabCommitStatus(name: 'Cleanup Dev') { stage('Cleanup') {
script { steps {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy" gitlabCommitStatus(name: 'Cleanup Dev') {
} script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
} }
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled'
echo "Milvus Cleanup Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
}
}
} }
} }
} }
...@@ -342,3 +373,4 @@ spec: ...@@ -342,3 +373,4 @@ spec:
} }
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册