try git ref
Some checks are pending
Build Multiarch Container Image / call-reusable-workflow (push) Waiting to run
Some checks are pending
Build Multiarch Container Image / call-reusable-workflow (push) Waiting to run
This commit is contained in:
parent
c908b4a7b5
commit
1a6b03835f
1 changed files with 10 additions and 10 deletions
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
@ -4,24 +4,24 @@ pipeline {
|
||||||
CONTAINER_REGISTRY = credentials("container_registry")
|
CONTAINER_REGISTRY = credentials("container_registry")
|
||||||
REGISTRY_NAMESPACE = credentials("registry_namespace")
|
REGISTRY_NAMESPACE = credentials("registry_namespace")
|
||||||
REPO_NAME = env.GIT_URL.replaceFirst(/^.*\/([^\/]+?).git$/, '$1')
|
REPO_NAME = env.GIT_URL.replaceFirst(/^.*\/([^\/]+?).git$/, '$1')
|
||||||
ARCHITECTURES = ['aarch64', 'x86_64']
|
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage("Build") {
|
stage("Build") {
|
||||||
when { tag "*" }
|
when { tag "*" }
|
||||||
parallel {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
def architectures = ['aarch64', 'x86_64']
|
||||||
def parallelStages = [:]
|
def parallelStages = [:]
|
||||||
|
|
||||||
ARCHITECTURES.each { arch ->
|
for (arch in architectures) {
|
||||||
|
// Need to bind the label variable before the closure
|
||||||
|
def nodeLabel = arch
|
||||||
|
|
||||||
parallelStages[arch] = {
|
parallelStages[arch] = {
|
||||||
stage(arch) {
|
node(nodeLabel) {
|
||||||
agent { label arch }
|
sh "podman build -t ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-${nodeLabel} ."
|
||||||
steps {
|
sh "podman save -o ${nodeLabel}.tar ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-${nodeLabel}"
|
||||||
sh "podman build -t ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-${arch} ."
|
stash includes: "${nodeLabel}.tar", name: "${nodeLabel}-image"
|
||||||
sh "podman save -o ${arch}.tar ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-${arch}"
|
|
||||||
stash includes: "${arch}.tar", name: "${arch}-image"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue