diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 7e342dbb1..a8aab44a5 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -63,6 +63,16 @@ pipeline { } post { + always { + timestamps { + withEnv([ + "KUBECONFIG=${params.KUBECONFIG}", + "TESTNAMESPACE=${params.TESTNAMESPACE}-${env.GIT_COMMIT}", + ]) { + sh "make cleanup-tests" + } + } + } failure { notifySlack('FAILURE') } diff --git a/Makefile b/Makefile index 276440f8d..670a898da 100644 --- a/Makefile +++ b/Makefile @@ -182,6 +182,9 @@ endif -test.v kubectl delete namespace $(TESTNAMESPACE) --ignore-not-found --now +cleanup-tests: + kubectl delete namespace $(TESTNAMESPACE) --ignore-not-found --now + # Release building docker-push: docker