diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..c656184 --- /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 -b 2025.05.x --depth 1; else git -C buildroot pull; fi' + } + } + } + + stage('Build') { + steps { + sh 'make -C ~/src/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