ci: Use containerimages pipeline library
All checks were successful
dustin/tmpl/pipeline/head This commit looks good
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:
74
ci/Jenkinsfile
vendored
74
ci/Jenkinsfile
vendored
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user