Skip to content

Commit

Permalink
prepare jenkins for multi-os build
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Sep 24, 2024
1 parent 89530c6 commit b652e5c
Showing 1 changed file with 49 additions and 25 deletions.
74 changes: 49 additions & 25 deletions jenkins/linux-plugins.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env groovy
pipeline {
agent none
agent {
label 'docker'
}
Expand All @@ -18,39 +19,62 @@ pipeline {
defaultValue: false,
description: 'Rebuilds VCPKG dependencies.',
name: 'REBUILD_VCPKG')

booleanParam(
defaultValue: true,
description: 'Check to enable Linux build',
name: 'shouldBuildLinux')

booleanParam(
defaultValue: true,
description: 'Check to enable Windows build',
name: 'shouldBuildWindows')

booleanParam(
defaultValue: true,
description: 'Check to enable macOS build',
name: 'shouldBuildMac')
}

stages {
stage('Build') {
agent {
dockerfile {
additionalBuildArgs '--target clap-plugins-build'
filename 'Dockerfile'
reuseNode true
}
}
options {
timeout(time: 4, unit: 'HOURS')
}
steps {
script {
if (CLEAN_BUILD) {
sh 'rm -rf builds'
parallel {
stage('Linux') {
when {
expression {
return params.shouldBuildLinux
}
}
if (REBUILD_VCPKG) {
sh 'rm -rf vcpkg/{installed,buildtree} ~/.cache/vcpkg'
agent {
dockerfile {
additionalBuildArgs '--target clap-plugins-build'
filename 'Dockerfile'
reuseNode true
}
}
options {
timeout(time: 4, unit: 'HOURS')
}
steps {
script {
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
zip zipFile: 'linux-vcpkg-logs.zip', archive: true, overwrite: true,
glob: 'vcpkg/buildtrees/**/*.log, vcpkg/installed/vcpkg/issue_body.md'
}
}
}
sh 'scripts/build-gui.sh'
}
}
}

post {
always {
archiveArtifacts artifacts: 'builds/ninja-vcpkg/plugins/Release/clap-plugins.clap', fingerprint: true
zip zipFile: 'linux-vcpkg-logs.zip', archive: true, overwrite: true,
glob: 'vcpkg/buildtrees/**/*.log, vcpkg/installed/vcpkg/issue_body.md'
}
}
}

0 comments on commit b652e5c

Please sign in to comment.