diff --git a/Dockerfile b/Dockerfile index 03d4bd5..c1bd329 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM debian:stable-slim AS clap-plugin-build +FROM debian:stable-slim AS clap-plugins-build ARG DEBIAN_FRONTEND=noninteractive ARG CACHE_DATE=2024-09-04 diff --git a/jenkins/linux-plugins.groovy b/jenkins/linux-plugins.groovy new file mode 100644 index 0000000..8243472 --- /dev/null +++ b/jenkins/linux-plugins.groovy @@ -0,0 +1,52 @@ +#!/usr/bin/env groovy +pipeline { + agent { + label 'linux-docker' + } + + parameters { + string( + defaultValue: 'main', name: 'BRANCH_OR_COMMIT_HASH', + description: 'Git branch name or commit hash to build. Defaults to tip of main branch.') + + booleanParam( + defaultValue: false, + description: 'Cleanups the build directory.', + name: 'CLEAN_BUILD') + + booleanParam( + defaultValue: false, + description: 'Rebuilds VCPKG dependencies.', + name: 'REBUILD_VCPKG') + } + + stages { + stage('Build') { + agent { + dockerfile { + additionalBuildArgs '--target clap-plugins-build' + filename 'Dockerfile' + reuseNode true + } + } + options { + timeout(time: 4, unit: 'HOURS') + } + steps { + if (CLEAN_BUILD) { + sh 'rm -rf builds' + } + if (REBUILD_VCPKG) { + sh 'rm -rf vcpkg/{installed,buildtree} ~/.cache/vcpkg' + } + sh 'scripts/build-gui.sh' + } + } + } + + post { + always { + archiveArtifacts artifacts: 'builds/ninja-vcpkg/plugins/Release/clap-plugins.clap', fingerprint: true + } + } +}