mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Avoid cases of filenames Update years in terms and other legal(ish) documents Don't update years in license headers, since change is not meaningful Will add linter rule in seperate commit Happy recompiling everyone! Original Patch By: Nescio Comment By: Gallaecio Differential Revision: D2620 This was SVN commit r27786.
87 lines
2.2 KiB
Text
87 lines
2.2 KiB
Text
/* Copyright (C) 2022 Wildfire Games.
|
||
* This file is part of 0 A.D.
|
||
*
|
||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation, either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* 0 A.D. is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
||
*/
|
||
|
||
// This pipeline is used to build a clean base from scratch in order to
|
||
// use ZFS snapshots efficiently.
|
||
|
||
def compilers = ["gcc7", "clang7"]
|
||
|
||
def volumeUpdatesMap = compilers.collectEntries {
|
||
["${it}": volumeUpdate(it)]
|
||
}
|
||
def volumeUpdate(compiler) {
|
||
return {
|
||
stage("Recreate: ${compiler}") {
|
||
sh "sudo zfs clone zpool0/trunk@base zpool0/${compiler}"
|
||
}
|
||
}
|
||
}
|
||
|
||
def buildsMap = compilers.collectEntries {
|
||
["${it}": build(it)]
|
||
}
|
||
def build(compiler) {
|
||
return {
|
||
stage("Build: ${compiler}") {
|
||
try {
|
||
ws("/zpool0/${compiler}") {
|
||
docker.image("0ad-${compiler}:latest").inside {
|
||
sh "build/workspaces/update-workspaces.sh -j1 --jenkins-tests"
|
||
|
||
sh "cd build/workspaces/gcc/ && make -j1 config=debug"
|
||
sh "binaries/system/test_dbg"
|
||
|
||
sh "cd build/workspaces/gcc/ && make -j1 config=release"
|
||
sh "binaries/system/test"
|
||
}
|
||
}
|
||
} catch (e) {
|
||
throw e
|
||
} finally {
|
||
sh "sudo zfs snapshot zpool0/${compiler}@latest"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
pipeline {
|
||
agent {
|
||
node {
|
||
label 'LinuxSlave'
|
||
customWorkspace '/zpool0/trunk'
|
||
}
|
||
}
|
||
|
||
stages {
|
||
stage("Volume updates") {
|
||
steps {
|
||
// Note: latest must always be the last snapshot in order to be able to rollback to it
|
||
sh "sudo zfs rollback zpool0/trunk@latest"
|
||
sh "sudo zfs destroy -R zpool0/trunk@latest"
|
||
sh "sudo zfs destroy -R zpool0/trunk@base"
|
||
sh "sudo zfs snapshot zpool0/trunk@base"
|
||
sh "sudo zfs snapshot zpool0/trunk@latest"
|
||
script { parallel volumeUpdatesMap }
|
||
}
|
||
}
|
||
stage("Build") {
|
||
steps {
|
||
script { parallel buildsMap }
|
||
}
|
||
}
|
||
}
|
||
}
|