This repository has been archived on 2025-09-06. You can view files and clone it, but cannot push or open issues/pull-requests.
container-images/ci/Jenkinsfile

65 lines
1.9 KiB
Groovy

pipeline {
agent {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
yamlMergeStrategy merge()
defaultContainer 'buildah'
}
}
stages {
stage('Prepare') {
steps {
container('jnlp') {
// TODO checkout lib/ branch based on $BRANCH_NAME
sh 'git fetch origin lib/main:lib/main'
sh 'git worktree add lib lib/main'
}
}
}
stage('Build') {
steps {
sh 'sh -e build.sh --base git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu'
}
}
stage('Push') {
steps {
withEnv([
"REGISTRY_AUTH_FILE=${env.WORKSPACE_TMP}/auth.json"
]) {
withCredentials([usernamePassword(
credentialsId: 'jenkins-packages',
usernameVariable: 'BUILDAH_USERNAME',
passwordVariable: 'BUILDAH_PASSWORD',
)]) {
sh """
buildah login \
--username \${BUILDAH_USERNAME} \
--password \${BUILDAH_PASSWORD} \
git.pyrocufflink.net
"""
}
sh 'buildah push aimee-os.org/build/rust-cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/rust-cross-aarch64-unknown-linux-gnu'
}
}
}
}
post {
success {
build "${BRANCH_NAME.replace('rust-cross/', 'build%2F')}"
}
failure {
sh 'unshare -Ur --map-auto chown root:root -R tmp log'
dir('tmp/portage') {
archiveArtifacts '*/*/temp/*.log'
}
archiveArtifacts 'log/**/*'
}
}
}