1
0
forked from 0ad/0ad

Allow to force non-incremental Jenkins builds

In all the builds using precompiled headers, an update to libraries will
crash the CI, as those headers will become outdated. It is then
necessary to force a full rebuild of the game by cleaning up the
workspaces.

This commit allows this CI behavior to be triggered by specifying
[CLEANBUILD] in the first line of the commit message.
This will constitute an opportunity to inform users that they need to
clean their workspaces when pulling the update.
This commit is contained in:
Nicolas Auvray 2024-08-27 11:30:05 +02:00
parent 2a67c9a503
commit ee3318309b
Signed by untrusted user: Itms
GPG Key ID: C7E52BD14CE14E09
4 changed files with 69 additions and 0 deletions

View File

@ -35,6 +35,16 @@ pipeline {
LLVM_OBJDUMP = '/usr/bin/llvm-objdump'
}
stages {
stage("Cleanup") {
when {
changelog '.*\\[CLEANBUILD\\].*'
}
steps {
script { env.CLEANBUILD = 'true' }
sh "git clean -fdx build/ source/"
}
}
stage ("Pre-build") {
steps {
discoverGitReferenceBuild()
@ -70,6 +80,11 @@ pipeline {
post {
always {
script {
if (env.CLEANBUILD == 'true') {
sh "git clean -fdx build/ source/"
}
}
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: clang()
}
}

View File

@ -60,12 +60,26 @@ pipeline {
}
stages {
stage("Cleanup") {
when {
allOf {
environment name: 'JENKINS_PCH', value: 'pch'
changelog '.*\\[CLEANBUILD\\].*'
}
}
steps {
script { env.CLEANBUILD = 'true' }
sh "git clean -fdx build/ source/"
}
}
stage("Pre-build") {
steps {
sh "git lfs pull -I binaries/data/tests"
sh "git lfs pull -I \"binaries/data/mods/_test.*\""
sh "libraries/build-source-libs.sh -j1 2> ${JENKINS_COMPILER}-prebuild-errors.log"
script {
if (env.JENKINS_PCH == "no-pch") {
sh "build/workspaces/update-workspaces.sh -j1 --jenkins-tests --without-pch 2>> ${JENKINS_COMPILER}-prebuild-errors.log"
@ -109,6 +123,16 @@ pipeline {
}
}
}
post {
always {
script {
if (env.CLEANBUILD == 'true' && env.JENKINS_PCH == 'pch') {
sh "git clean -fdx build/ source/"
}
}
}
}
}
post {

View File

@ -29,6 +29,16 @@ pipeline {
}
stages {
stage("Cleanup") {
when {
changelog '.*\\[CLEANBUILD\\].*'
}
steps {
script { env.CLEANBUILD = 'true' }
sh "git clean -fdx build/ source/"
}
}
stage ("Pre-build") {
steps {
discoverGitReferenceBuild()
@ -77,6 +87,11 @@ pipeline {
post {
always {
script {
if (env.CLEANBUILD == 'true') {
sh "git clean -fdx build/ source/"
}
}
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: clang()
}
}

View File

@ -32,6 +32,16 @@ pipeline {
}
stages {
stage("Cleanup") {
when {
changelog '.*\\[CLEANBUILD\\].*'
}
steps {
script { env.CLEANBUILD = 'true' }
bat "git clean -fdx build/ source/"
}
}
stage ("Pre-build") {
steps {
discoverGitReferenceBuild()
@ -77,6 +87,11 @@ pipeline {
post {
always {
script {
if (env.CLEANBUILD == 'true') {
bat "git clean -fdx build/ source/"
}
}
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: msBuild()
}
}