From 01a109b58526532d562c4fb1fc18f73cb021f324 Mon Sep 17 00:00:00 2001 From: Dominik Chilla Date: Fri, 14 Jun 2019 21:36:33 +0200 Subject: [PATCH] Jenkins scripted multibranch pipeline --- Jenkinsfile | 32 +++++++++++++++++++++++++++++++- Jenkinsfile.scripted.multibranch | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) mode change 120000 => 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 120000 index e1a64f9..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1 +0,0 @@ -Jenkinsfile.scripted.multibranch \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f8281dd --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +node { + def app + + stage('Clone repository') { + sh '/usr/bin/env' + checkout scm + } + + stage('Build image') { + sh '/usr/bin/env' + /* Multi-Branch Pipeline works with env.BRANCH_NAME*/ + app = docker.build("sos-milter:${env.BRANCH_NAME}","--pull --label BUILD_URL=${env.BUILD_URL} .") + } + + stage('Test image') { + app.inside { + sh '/usr/bin/env' + sh '/bin/ps auxwwf' + } + } + + stage('Push image') { + docker.withRegistry('https://dockreg-fra.zwackl.de') { + app.push() + } + } + + stage('Cleanup') { + sh 'echo "TODO: cleanup!"' + } +} diff --git a/Jenkinsfile.scripted.multibranch b/Jenkinsfile.scripted.multibranch index 50f7bca..f8281dd 100644 --- a/Jenkinsfile.scripted.multibranch +++ b/Jenkinsfile.scripted.multibranch @@ -5,7 +5,7 @@ node { sh '/usr/bin/env' checkout scm } - + stage('Build image') { sh '/usr/bin/env' /* Multi-Branch Pipeline works with env.BRANCH_NAME*/