This repository has been archived on 2025-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
Files
container-images/ci/Jenkinsfile
Dustin C. Hatch 9377c9423c ci: Fix file ownership before archiving
Several log files in `/var/log` are owned by users other than root.
From outside the user namespace, these files are inaccessible to the
unprivileged user, so we need to change their ownership before we can
archive them.
2024-12-14 14:17:33 -06:00

71 lines
2.1 KiB
Groovy

pipeline {
agent {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
yamlMergeStrategy merge()
defaultContainer 'buildah'
}
}
stages {
stage('Gentoo Stage 3') {
steps {
sh 'sh -e image-build/gentoo-stage3.sh'
}
}
stage('Base') {
steps {
sh 'sh -e image-build/base.sh'
}
}
stage('Cross') {
steps {
sh 'sh -e image-build/cross.sh'
}
}
stage('Build') {
steps {
sh 'sh -e image-build/build.sh'
}
}
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/base git.pyrocufflink.net/aimeeos/build/base'
sh 'buildah push aimee-os.org/build/cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu'
sh 'buildah push aimee-os.org/build/build-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/build-aarch64-unknown-linux-gnu'
}
}
}
}
post {
failure {
sh 'unshare -Ur --map-auto chown root:root -R tmp log'
dir('tmp/portage') {
archiveArtifacts '*/*/temp/*.log'
}
archiveArtifacts 'log/**/*'
}
}
}