73 lines
2.2 KiB
Groovy
73 lines
2.2 KiB
Groovy
pipeline {
|
|
agent none
|
|
|
|
stages {
|
|
|
|
stage('Build Container') {
|
|
matrix {
|
|
axes {
|
|
axis {
|
|
name 'ARCH'
|
|
values 'amd64', 'arm64'
|
|
}
|
|
}
|
|
stages {
|
|
stage('Container') {
|
|
agent {
|
|
kubernetes {
|
|
yamlFile 'ci/podTemplate-container.yaml'
|
|
yamlMergeStrategy merge()
|
|
defaultContainer 'buildah'
|
|
nodeSelector "kubernetes.io/arch=${ARCH}"
|
|
}
|
|
}
|
|
|
|
stages {
|
|
stage('Build') {
|
|
steps {
|
|
sh '. ci/build-container.sh'
|
|
stash name: env.ARCH, includes: "*.oci.tar"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Publish Container') {
|
|
agent {
|
|
kubernetes {
|
|
yamlFile 'ci/podTemplate-container.yaml'
|
|
yamlMergeStrategy merge()
|
|
defaultContainer 'buildah'
|
|
}
|
|
}
|
|
|
|
environment {
|
|
REGISTRY_AUTH_FILE = "${env.WORKSPACE_TMP}/auth.json"
|
|
}
|
|
|
|
steps {
|
|
unstash 'amd64'
|
|
unstash 'arm64'
|
|
withCredentials([usernamePassword(
|
|
credentialsId: 'jenkins-packages',
|
|
usernameVariable: 'BUILDAH_USERNAME',
|
|
passwordVariable: 'BUILDAH_PASSWORD',
|
|
)]) {
|
|
sh """
|
|
buildah login \
|
|
--username \${BUILDAH_USERNAME} \
|
|
--password \${BUILDAH_PASSWORD} \
|
|
git.pyrocufflink.net
|
|
"""
|
|
}
|
|
sh '. ci/publish.sh'
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|