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
1a6b03835f
commit
b573cea026
1 changed files with 15 additions and 18 deletions
33
Jenkinsfile
vendored
33
Jenkinsfile
vendored
|
@ -8,25 +8,22 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage("Build") {
|
stage("Build") {
|
||||||
when { tag "*" }
|
when { tag "*" }
|
||||||
steps {
|
parallel {
|
||||||
script {
|
stage("aarch64") {
|
||||||
def architectures = ['aarch64', 'x86_64']
|
agent { label "aarch64" }
|
||||||
def parallelStages = [:]
|
steps {
|
||||||
|
sh "podman build -t ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-aarch64 ."
|
||||||
for (arch in architectures) {
|
sh "podman save -o aarch64.tar ${CONTAINER_REGISTRY}/${REGISTRY_NAMESPACE}/${REPO_NAME}:${env.BRANCH_NAME}-aarch64"
|
||||||
// Need to bind the label variable before the closure
|
stash includes: "aarch64.tar", name: 'aarch64-image'
|
||||||
def nodeLabel = arch
|
}
|
||||||
|
}
|
||||||
parallelStages[arch] = {
|
stage("x86_64") {
|
||||||
node(nodeLabel) {
|
agent { label "x86_64" }
|
||||||
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}-x86_64 ."
|
||||||
stash includes: "${nodeLabel}.tar", name: "${nodeLabel}-image"
|
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue