ci: Use containerimages pipeline library
All checks were successful
dustin/tmpl/pipeline/head This commit looks good

The `buildContainerImage2` function now accepts a `pi` argument, which
controls whether or not the build can run on a Raspberry Pi.  Since the
only reason we were not using this function before was to avoid building
on a Pi, we no longer need the custom code.
This commit is contained in:
2024-01-19 10:27:38 -06:00
parent d25d876df5
commit d84603a6ac
5 changed files with 5 additions and 122 deletions

74
ci/Jenkinsfile vendored
View File

@@ -1,70 +1,6 @@
pipeline {
agent none
@Library('containerimages')_
stages {
stage('Build') {
matrix {
axes {
axis {
name 'ARCH'
values 'amd64', 'arm64'
}
}
stages {
stage('Build') {
agent {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
yamlMergeStrategy merge()
defaultContainer 'buildah'
nodeSelector "kubernetes.io/arch=${ARCH}"
}
}
stages {
stage("Build") {
steps {
sh '. ci/build.sh'
stash name: env.ARCH, includes: "*.oci.tar"
}
}
}
}
}
}
}
stage('Publish') {
agent {
kubernetes {
yamlFile 'ci/podTemplate.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'
}
}
}
}
buildContainerImage2(
archlist: ['amd64', 'arm64'],
pi: false,
)