tmpl/ci/Jenkinsfile

65 lines
2.3 KiB
Groovy

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}"
}
}
env {
REGISTRY_AUTH_FILE = "${env.WORKSPACE_TMP}/auth.json"
}
stages {
stage('Build') {
steps {
sh '. ci/build.sh'
}
post {
success {
archiveArtifacts "${ARCH}/*"
}
}
}
stage('Publish') {
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'
}
}
}
}
}
}
}
}
}