From abeadc705242c9f713bdd233cef83ba207df7660 Mon Sep 17 00:00:00 2001 From: Dominik Chilla Date: Thu, 13 Jun 2019 10:41:50 +0200 Subject: [PATCH] First jenkins build --- Jenkinsfile | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8759a5e..a8f8d92 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,23 +1,29 @@ node { - def app + def app - stage('Clone repository') { - /* Let's make sure we have the repository cloned to our workspace */ - checkout scm - } + stage('Clone repository') { + /* Let's make sure we have the repository cloned to our workspace */ + checkout scm + } - stage('Build image') { - sh '/usr/bin/env' - /* This builds the actual image; synonymous to - * docker build on the command line */ - app = docker.build("jenkins/sos-milter") - } + stage('Build image') { + sh '/usr/bin/env' + /* This builds the actual image; synonymous to + * docker build on the command line */ + app = docker.build("jenkins/sos-milter") + } - stage('Test image') { - /* Ideally, we would run a test framework against our image. - * For this example, we're using a Volkswagen-type approach ;-) */ - app.inside { - sh 'echo "Tests passed"' - } + stage('Test image') { + /* Ideally, we would run a test framework against our image. + * For this example, we're using a Volkswagen-type approach ;-) */ + app.inside { + sh 'echo "Tests passed"' + } + } + + stage('Push image') { + docker.withRegistry('http://dockreg-fra.zwackl.local:5000') { + app.push() } + } }