From 15fbb180d0cae60ad7f5450e72c48b4d7bbf4134 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 6 Dec 2024 08:23:27 -0600 Subject: [PATCH] ci: Begin Jenkins build pipeline --- ci/Jenkinsfile | 57 +++++++++++++++++++++++++++++++++++++++++++++ ci/podTemplate.yaml | 20 ++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 ci/Jenkinsfile create mode 100644 ci/podTemplate.yaml diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..d12ee0d --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,57 @@ +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/cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu' + } + } + } + } +} diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..3482526 --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,20 @@ +spec: + containers: + - name: buildah + image: quay.io/containers/buildah:v1 + command: + - sh + - -c + - | + trap 'kill $!; exit' TERM + rm -f ~/.config/containers/storage.conf + sleep infinity & + wait + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + resources: + limits: + github.com/fuse: 1 + tolerations: + - key: du5t1n.me/jenkins