diff --git a/Jenkinsfile b/Jenkinsfile index c3112f8..c058410 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,12 +6,22 @@ node("docker-node") { sh "git rev-parse HEAD > .git/commit-id" def commit_id = readFile('.git/commit-id').trim() println commit_id + + try { + stage "build" + def app = docker.build "library/x86_64/alpine/transmission" - stage "build" - def app = docker.build "library/x86_64/alpine/transmission" - - stage "publish" - app.push("${env.BUILD_NUMBER}") - app.push("latest") + stage "publish" + app.push("${env.BUILD_NUMBER}") + app.push("latest") + + stage('Deploy on K8s'){ + sh "/usr/local/bin/kubectl -n media delete po transmission-0" + } + } + catch (err) { + currentBuild.result = 'FAILURE' + } + } }