From 8f86d83732e2716309dbb454a8395a8408691f39 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Fri, 1 Apr 2022 17:45:44 -0500 Subject: [PATCH] playing around with stage/script tags --- build-ubi.jenkins | 56 +++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/build-ubi.jenkins b/build-ubi.jenkins index e2ca47e..ef1f61f 100644 --- a/build-ubi.jenkins +++ b/build-ubi.jenkins @@ -22,31 +22,26 @@ pipeline { } stages { - stage ('Initalize Jenkins') { - steps { - script { + steps { + script { + stage ('Initalize Jenkins') { workspace = pwd() ubiOS = ["8"] ubiImages = ["ubi-minimal", "ubi"] writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getLocalRootCA()) } - } - } - stage ('Build Images') { - steps { - script { - for (rhOS in ubiOS) { - for (image in ubiImages) { - stage ("Build ubi${rhOS}:${image}") { - def updateCmd - if (image == "ubi-minimal") { - updateCmd = "microdnf" - } else { - updateCmd = "dnf" - } - dockerFile = """FROM registry.access.redhat.com/ubi${rhOS}/${image}:latest + for (rhOS in ubiOS) { + for (image in ubiImages) { + stage ("Build ubi${rhOS}:${image}") { + def updateCmd + if (image == "ubi-minimal") { + updateCmd = "microdnf" + } else { + updateCmd = "dnf" + } + dockerFile = """FROM registry.access.redhat.com/ubi${rhOS}/${image}:latest LABEL org.opencontainers.image.authors="The_Spider " LABEL org.opencontainers.image.title="ubi${rhOS}/${image}" @@ -59,20 +54,19 @@ RUN update-ca-trust extract && \\ ${updateCmd} update -y && \\ ${updateCmd} clean all """ - container ("kaniko") { - declarativeFunctions.buildContainerMultipleDestinations( - dockerFile: dockerFile, - repositoryAccess: [ - [ - repository: repository, - credentials: repositoryCreds - ], + container ("kaniko") { + declarativeFunctions.buildContainerMultipleDestinations( + dockerFile: dockerFile, + repositoryAccess: [ + [ + repository: repository, + credentials: repositoryCreds ], - destination: [ - "${repository}/library/rhubi/${image}:${rhOS}", - ] - ) - } + ], + destination: [ + "${repository}/library/rhubi/${image}:${rhOS}", + ] + ) } } }