From 7b99ead0eb0058ef359f15968058950c759d2079 Mon Sep 17 00:00:00 2001 From: lbrinkhaus Date: Wed, 26 Jan 2022 23:48:56 +0100 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2d39ca0..9cfe67b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,33 @@ node { def app + agent any - stage('Clone repository') { - /* Let's make sure we have the repository cloned to our workspace */ + stages { + stage('Clone repository') { + /* Let's make sure we have the repository cloned to our workspace */ - checkout scm - } + checkout scm + } - stage('Build 6.2.6 image') { - /* This builds the actual image; synonymous to - * docker build on the command line */ - def dockerfile = "6.2/Dockerfile" - app = docker.build("harbor.dragse.it/base/redis", "-f ${dockerfile} ./6.2 ") - } + stage('Build 6.2.6 image') { + /* This builds the actual image; synonymous to + * docker build on the command line */ + def dockerfile = "6.2/Dockerfile" + app = docker.build("harbor.dragse.it/base/redis", "-f ${dockerfile} ./6.2 ") + } - stage('Push image') { - /* Finally, we'll push the image with two tags: - * First, the incremental build number from Jenkins - * Second, the 'latest' tag. - * Pushing multiple tags is cheap, as all the layers are reused. */ - docker.withRegistry('https://harbor.dragse.it', 'harbor-repo') { - app.push("${env.BUILD_NUMBER}") - app.push("6") - app.push("6.2") - app.push("6.2.6") - app.push("latest") + stage('Push image') { + /* Finally, we'll push the image with two tags: + * First, the incremental build number from Jenkins + * Second, the 'latest' tag. + * Pushing multiple tags is cheap, as all the layers are reused. */ + docker.withRegistry('https://harbor.dragse.it', 'harbor-repo') { + app.push("${env.BUILD_NUMBER}") + app.push("6") + app.push("6.2") + app.push("6.2.6") + app.push("latest") + } } } }