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 { failure { sh 'unshare -Ur --map-auto chown root:root -R tmp log' dir('tmp/portage') { archiveArtifacts '*/*/temp/*.log' } archiveArtifacts 'log/**/*' } } }