mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
Add Linux build stage to Jenkinsfile
This commit is contained in:
parent
091983b3e3
commit
18cbc16a49
1 changed files with 70 additions and 77 deletions
147
Jenkinsfile
vendored
147
Jenkinsfile
vendored
|
@ -1,29 +1,26 @@
|
|||
pipeline {
|
||||
|
||||
environment {
|
||||
MSBUILD='C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Msbuild\\Current\\Bin\\msbuild.exe'
|
||||
CONFIG='Release'
|
||||
OTRPLATFORM='x64'
|
||||
PLATFORM='x86'
|
||||
ZIP='C:\\Program Files\\7-Zip\\7z.exe'
|
||||
PYTHON='C:\\Users\\jenkins\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
|
||||
TOOLSET='v142'
|
||||
EMAILTO=''
|
||||
}
|
||||
|
||||
agent {
|
||||
label 'SoH-Builders'
|
||||
}
|
||||
|
||||
agent none
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
timeout(time: 15, unit: 'MINUTES')
|
||||
timeout(time: 30, unit: 'MINUTES')
|
||||
skipDefaultCheckout(true)
|
||||
}
|
||||
|
||||
|
||||
stages {
|
||||
|
||||
stage ('Checkout') {
|
||||
stage ('Build Windows') {
|
||||
environment {
|
||||
MSBUILD='C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Msbuild\\Current\\Bin\\msbuild.exe'
|
||||
CONFIG='Release'
|
||||
OTRPLATFORM='x64'
|
||||
PLATFORM='x86'
|
||||
ZIP='C:\\Program Files\\7-Zip\\7z.exe'
|
||||
PYTHON='C:\\Users\\jenkins\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
|
||||
TOOLSET='v142'
|
||||
}
|
||||
agent {
|
||||
label "SoH-Builders"
|
||||
}
|
||||
steps {
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
|
@ -32,68 +29,64 @@ pipeline {
|
|||
extensions: scm.extensions,
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
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.MSBUILD}" ".\\soh\\soh.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.PLATFORM};PlatformToolset=${env.TOOLSET} /nodeReuse:false /m
|
||||
|
||||
"${env.ZIP}" a "soh.zip" ".\\soh\\Release\\soh.exe"
|
||||
|
||||
"""
|
||||
archiveArtifacts artifacts: 'soh.zip', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
step([$class: 'WsCleanup']) // Clean workspace
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Build OTRExporter') {
|
||||
stage ('Build Linux') {
|
||||
agent {
|
||||
label "SoH-Linux-Builders"
|
||||
}
|
||||
steps {
|
||||
bat """
|
||||
|
||||
"${env.MSBUILD}" ".\\OTRExporter\\OTRExporter.sln" -t:restore,build -p:Configuration=${env.CONFIG};Platform=${env.OTRPLATFORM};PlatformToolset=${env.TOOLSET};RestorePackagesConfig=true /nodeReuse:false
|
||||
|
||||
"""
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: scm.branches,
|
||||
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
|
||||
extensions: scm.extensions,
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
sh '''
|
||||
|
||||
sudo cp ../../ZELOOTD.z64 OTRExporter/baserom_non_mq.z64
|
||||
sudo docker build . -t soh
|
||||
sudo docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash
|
||||
sudo cp ../../buildsoh.bash soh
|
||||
sudo docker exec sohcont soh/buildsoh.bash
|
||||
sudo zip soh-linux.zip ./soh/soh.elf
|
||||
|
||||
'''
|
||||
}
|
||||
sh 'sudo docker container stop sohcont'
|
||||
archiveArtifacts artifacts: 'soh-linux.zip', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Extract assets') {
|
||||
steps {
|
||||
bat """
|
||||
|
||||
xcopy "..\\..\\ZELOOTD.z64" "OTRExporter\\"
|
||||
|
||||
cd "OTRExporter"
|
||||
"${env.PYTHON}" ".\\extract_assets.py"
|
||||
cd "${env.WORKSPACE}"
|
||||
|
||||
"""
|
||||
post {
|
||||
always {
|
||||
step([$class: 'WsCleanup']) // Clean workspace
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue