pipeline { parameters { booleanParam 'CLEAN_BUILD' string 'CUSTOM_TARGET' } options { disableConcurrentBuilds() } agent { kubernetes { yamlFile 'ci/podTemplate.yaml' workspaceVolume persistentVolumeClaimWorkspaceVolume( claimName: 'buildroot-airplaypi' ) 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 { checkout( poll: false, scm: scmGit( branches: [[name: 'refs/tags/2025.05.1']], browser: gitLab('https://gitlab.com/buildroot.org/buildroot/'), extensions: [ [ $class: 'RelativeTargetDirectory', relativeTargetDir: 'buildroot', ], cloneOption( shallow: true, depth: 1, ), ], userRemoteConfigs: [[ url: 'https://gitlab.com/buildroot.org/buildroot.git', ]], ) ) container('jnlp') { sh 'if [ ! -d aimee-os ]; then git clone https://git.pyrocufflink.net/AimeeOS/aimee-os.git --depth 1; else git -C aimee-os pull; fi' } } } stage('Build') { steps { sh '{ cat airplaypi_defconfig.in ; grep BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION buildroot/configs/raspberrypi3_defconfig; } > airplaypi_defconfig' sh 'make -C buildroot O="${PWD}"/_build BR2_EXTERNAL="${PWD}/aimee-os" defconfig BR2_DEFCONFIG="${PWD}"/airplaypi_defconfig' script { if (params.CUSTOM_TARGET) { sh "make -C _build '${CUSTOM_TARGET}'" } } sh 'make -C _build' } post { success { dir('_build') { archiveArtifacts('.config') } dir('_build/images') { sh 'zstd -f firmware.img' sh 'zstd -f sdcard.img' archiveArtifacts([ 'firmware.img.zst', 'rootfs.squashfs', 'sdcard.img.zst', 'update.tar.zstd', ].join(',')) } } } } } }