pipeline { agent none stages { stage('tmpl') { matrix { axes { axis { name 'ARCH' values 'amd64', 'arm64' } } stages { stage('tmpl') { agent { kubernetes { yamlFile 'podTemplate.yaml' yamlMergeStrategy merge() defaultContainer 'build' nodeSelector "kubernetes.io/arch=${ARCH}" } } stages { stage('Build') { steps { sh '. ci/build.sh' } post { success { archiveArtifacts "${ARCH}/*" } } } stage('Publish') { env { REGISTRY_AUTH_FILE = "${env.WORKSPACE_TMP}/auth.json" } steps { 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' } } } } } } } } }