From 6017f72178217a7d2e88d32c0e8aab20d720802b Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Tue, 27 Feb 2018 11:31:27 +0100 Subject: [PATCH] Cleanup kubernetes after tests --- Jenkinsfile.groovy | 10 ++++++++++ Makefile | 3 +++ 2 files changed, 13 insertions(+) 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