mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 17:32:19 -05:00
Add Linux build stage to Jenkinsfile (#270)
* Add Linux build stage to Jenkinsfile * Update Jenkinsfile * Add OTRGui * Pull in ZAPD.out to assets/extractor * Switch to 7z for artifacts
This commit is contained in:
parent
09432ee7f4
commit
ea78c7ea1e
139
Jenkinsfile
vendored
139
Jenkinsfile
vendored
@ -1,5 +1,14 @@
|
||||
pipeline {
|
||||
agent none
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
timeout(time: 30, unit: 'MINUTES')
|
||||
skipDefaultCheckout(true)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage ('Build Windows') {
|
||||
environment {
|
||||
MSBUILD='C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Msbuild\\Current\\Bin\\msbuild.exe'
|
||||
CONFIG='Release'
|
||||
@ -7,23 +16,12 @@ pipeline {
|
||||
PLATFORM='x86'
|
||||
ZIP='C:\\Program Files\\7-Zip\\7z.exe'
|
||||
PYTHON='C:\\Users\\jenkins\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
|
||||
CMAKE='C:\\Program Files\\CMake\\bin\\cmake.exe'
|
||||
TOOLSET='v142'
|
||||
EMAILTO=''
|
||||
}
|
||||
|
||||
agent {
|
||||
label 'SoH-Builders'
|
||||
label "SoH-Builders"
|
||||
}
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
timeout(time: 15, unit: 'MINUTES')
|
||||
skipDefaultCheckout(true)
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
stage ('Checkout') {
|
||||
steps {
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
@ -32,68 +30,89 @@ pipeline {
|
||||
extensions: scm.extensions,
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Build OTRExporter') {
|
||||
steps {
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
bat """
|
||||
|
||||
"${env.MSBUILD}" ".\\OTRExporter\\OTRExporter.sln" -t:restore,build -p:Configuration=${env.CONFIG};Platform=${env.OTRPLATFORM};PlatformToolset=${env.TOOLSET};RestorePackagesConfig=true /nodeReuse:false
|
||||
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Extract assets') {
|
||||
steps {
|
||||
bat """
|
||||
"${env.MSBUILD}" ".\\OTRExporter\\OTRExporter.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.OTRPLATFORM};PlatformToolset=${env.TOOLSET};RestorePackagesConfig=true /restore /nodeReuse:false /m
|
||||
|
||||
xcopy "..\\..\\ZELOOTD.z64" "OTRExporter\\"
|
||||
|
||||
cd "OTRExporter"
|
||||
"${env.PYTHON}" ".\\extract_assets.py"
|
||||
cd "${env.WORKSPACE}"
|
||||
cd "..\\"
|
||||
|
||||
"${env.MSBUILD}" ".\\soh\\soh.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.PLATFORM};PlatformToolset=${env.TOOLSET} /nodeReuse:false /m
|
||||
|
||||
cd OTRGui
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
"${env.CMAKE}" ..
|
||||
"${env.CMAKE}" --build . --config Release
|
||||
|
||||
cd "..\\..\\"
|
||||
|
||||
move "soh\\Release\\soh.exe" ".\\"
|
||||
move "OTRGui\\build\\assets" ".\\"
|
||||
move ".\\OTRExporter\\x64\\Release\\ZAPD.exe" ".\\assets\\extractor\\"
|
||||
move ".\\OTRGui\\build\\Release\\OTRGui.exe" ".\\"
|
||||
rename README.md readme.txt
|
||||
|
||||
"${env.ZIP}" a soh.7z soh.exe OTRGui.exe assets readme.txt
|
||||
|
||||
"""
|
||||
archiveArtifacts artifacts: 'soh.7z', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Build SoH') {
|
||||
steps {
|
||||
bat """
|
||||
|
||||
"${env.MSBUILD}" ".\\soh\\soh.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.PLATFORM};PlatformToolset=${env.TOOLSET} /nodeReuse:false
|
||||
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Archive artifacts') {
|
||||
steps {
|
||||
bat """
|
||||
|
||||
"${env.ZIP}" a "soh.zip" ".\\soh\\Release\\soh.exe"
|
||||
|
||||
"""
|
||||
|
||||
archiveArtifacts allowEmptyArchive: false,
|
||||
artifacts: 'soh.zip',
|
||||
caseSensitive: true,
|
||||
defaultExcludes: true,
|
||||
fingerprint: false,
|
||||
onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
step([$class: 'Mailer',
|
||||
notifyEveryUnstableBuild: true,
|
||||
recipients: "${env.EMAILTO}",
|
||||
sendToIndividuals: false])
|
||||
step([$class: 'WsCleanup']) // Clean workspace
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ('Build Linux') {
|
||||
agent {
|
||||
label "SoH-Linux-Builders"
|
||||
}
|
||||
steps {
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: scm.branches,
|
||||
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
|
||||
extensions: scm.extensions,
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
sh '''
|
||||
|
||||
cp ../../ZELOOTD.z64 OTRExporter/baserom_non_mq.z64
|
||||
docker build . -t soh
|
||||
docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash
|
||||
cp ../../buildsoh.bash soh
|
||||
docker exec sohcont soh/buildsoh.bash
|
||||
|
||||
mkdir build
|
||||
mv soh/soh.elf build/
|
||||
mv OTRGui/build/OTRGui build/
|
||||
mv OTRGui/build/assets build/
|
||||
mv ZAPDTR/ZAPD.out build/assets/extractor/
|
||||
mv README.md build/readme.txt
|
||||
cd build
|
||||
|
||||
7z a soh-linux.7z soh.elf OTRGui assets readme.txt
|
||||
mv soh-linux.7z ../
|
||||
|
||||
'''
|
||||
}
|
||||
sh 'sudo docker container stop sohcont'
|
||||
archiveArtifacts artifacts: 'soh-linux.7z', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
post {
|
||||
always {
|
||||
step([$class: 'WsCleanup']) // Clean workspace
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user