From b6c9425005aab57084a1302d25a68b55ad342b6d Mon Sep 17 00:00:00 2001 From: Dominik Chilla Date: Fri, 14 Jun 2019 21:33:39 +0200 Subject: [PATCH] Jenkins scripted multibranch pipeline --- Jenkinsfile.scripted.multibranch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile.scripted.multibranch b/Jenkinsfile.scripted.multibranch index 3d16e36..50f7bca 100644 --- a/Jenkinsfile.scripted.multibranch +++ b/Jenkinsfile.scripted.multibranch @@ -1,20 +1,19 @@ node { - def dockerImage + def app stage('Clone repository') { sh '/usr/bin/env' - /* Let's make sure we have the repository cloned to our workspace */ checkout scm } stage('Build image') { sh '/usr/bin/env' /* Multi-Branch Pipeline works with env.BRANCH_NAME*/ - dockerImage = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .") + app = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .") } stage('Test image') { - dockerImage.inside { + app.inside { sh '/usr/bin/env' sh '/bin/ps auxwwf' } @@ -22,7 +21,7 @@ node { stage('Push image') { docker.withRegistry('https://dockreg-fra.zwackl.de') { - dockerImage.push() + app.push() } }