From 2d05c3a5f1f3e82d5b1d4dd4871b4b3019dbbfca Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 20 Aug 2025 21:24:25 -0500 Subject: [PATCH] wip: ci: Add Jenkins pipeline --- .gitignore | 1 + ci/Jenkinsfile | 64 +++++++++++++++++++++++++++++++++++++++++++++ ci/podTemplate.yaml | 19 ++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .gitignore create mode 100644 ci/Jenkinsfile create mode 100644 ci/podTemplate.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a485625 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/_build diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..accda4b --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,64 @@ +pipeline { + parameters { + booleanParam 'CLEAN_BUILD' + } + + options { + disableConcurrentBuilds() + } + + agent { + kubernetes { + yamlFile 'ci/podTemplate.yaml' + yamlMergeStrategy merge() + workspaceVolume persistentVolumeClaimWorkspaceVolume( + claimName: 'buildroot-aimeeos' + ) + defaultContainer 'build' + } + } + + environment { + BR2_CCACHE_DIR = "${env.JENKINS_AGENT_WORKDIR}/br2-ccache" + } + + stages { + stage('Clean') { + when { + expression { + return params.CLEAN_BUILD + } + } + steps { + sh 'git clean -fdx' + } + } + + stage('Prepare') { + steps { + container('jnlp') { + sh 'if [ ! -d buildroot ]; then git clone https://gitlab.com/buildroot.org/buildroot.git -b 2025.05.x --depth 1; else git -C buildroot pull; fi' + } + } + } + + stage('Build') { + steps { + sh 'make -C buildroot O="${PWD}"/_build BR2_EXTERNAL="${PWD}" aimeeos_qemu_aarch64_defconfig' + sh 'make -C _build' + } + post { + success { + dir('_build') { + archiveArtifacts('.config') + } + dir('_build/images') { + archiveArtifacts([ + 'rootfs.squashfs', + ].join(',')) + } + } + } + } + } +} diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..a15cc3b --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,19 @@ +spec: + containers: + - name: build + image: git.pyrocufflink.net/containerimages/buildroot + resources: + limits: &resources + cpu: 6 + memory: 12Gi + requests: *resources + volumeMounts: + - mountPath: /etc/ssh/ssh_known_hosts + name: ssh-known-hosts + subPath: ssh_known_hosts + securityContext: + fsGroupChangePolicy: OnRootMismatch + volumes: + - name: ssh-known-hosts + configMap: + name: ssh-known-hosts