From b573cea0265820c598afb2bf1d289c14ab0d1334 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 4 Jun 2025 10:27:20 +0200 Subject: [PATCH] try git ref --- Jenkinsfile | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 470e7d2..e70687c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,25 +8,22 @@ pipeline { stages { stage("Build") { when { tag "*" } - steps { - script { - def architectures = ['aarch64', 'x86_64'] - def parallelStages = [:] - - for (arch in architectures) { - // Need to bind the label variable before the closure - def nodeLabel = arch - - parallelStages[arch] = { - node(nodeLabel) { - sh "podman build -t ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-${nodeLabel} ." - sh "podman save -o ${nodeLabel}.tar ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-${nodeLabel}" - stash includes: "${nodeLabel}.tar", name: "${nodeLabel}-image" - } - } + parallel { + stage("aarch64") { + agent { label "aarch64" } + steps { + sh "podman build -t ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-aarch64 ." + sh "podman save -o aarch64.tar ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-aarch64" + stash includes: "aarch64.tar", name: 'aarch64-image' + } + } + stage("x86_64") { + agent { label "x86_64" } + steps { + sh "podman build -t ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-x86_64 ." + sh "podman save -o x86_64.tar ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-x86_64" + stash includes: "x86_64.tar", name: 'x86_64-image' } - - parallel parallelStages } } }