Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
Set a timeout of 60 minutes on build steps in case they hang (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que committed Jun 3, 2017
1 parent f93ba7f commit 09c7b4f
Showing 1 changed file with 42 additions and 34 deletions.
76 changes: 42 additions & 34 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,53 @@ stage("Build") {
parallel (
"Windows" : {
node('windows') {
checkout poll: false, changelog: false, scm: scm
bat ("git clean -xdff")
bat ("Protobuild.exe --upgrade-all")
try {
bat ('Protobuild.exe --automated-build')
stash includes: '*.nupkg', name: 'windows-packages'
} finally {
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'Protogame.Tests/bin/Windows/AnyCPU/Debug/VisualHTML', reportFiles: 'index.html', reportName: 'Visual Test Report - Windows'])
timeout(60) {
checkout poll: false, changelog: false, scm: scm
bat ("git clean -xdff")
bat ("Protobuild.exe --upgrade-all")
try {
bat ('Protobuild.exe --automated-build')
stash includes: '*.nupkg', name: 'windows-packages'
} finally {
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'Protogame.Tests/bin/Windows/AnyCPU/Debug/VisualHTML', reportFiles: 'index.html', reportName: 'Visual Test Report - Windows'])
}
}
}
},
"Mac": {
node('mac') {
checkout poll: false, changelog: false, scm: scm
sh ("git clean -xdff")
sh ("mono Protobuild.exe --upgrade-all MacOS")
sh ("mono Protobuild.exe --upgrade-all Android")
sh ("mono Protobuild.exe --upgrade-all iOS")
try {
sh ("mono Protobuild.exe --automated-build")
stash includes: '*.nupkg', name: 'mac-packages'
} finally {
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'Protogame.Tests/bin/MacOS/AnyCPU/Debug/VisualHTML', reportFiles: 'index.html', reportName: 'Visual Test Report - macOS'])
timeout(60) {
checkout poll: false, changelog: false, scm: scm
sh ("git clean -xdff")
sh ("mono Protobuild.exe --upgrade-all MacOS")
sh ("mono Protobuild.exe --upgrade-all Android")
sh ("mono Protobuild.exe --upgrade-all iOS")
try {
sh ("mono Protobuild.exe --automated-build")
stash includes: '*.nupkg', name: 'mac-packages'
} finally {
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'Protogame.Tests/bin/MacOS/AnyCPU/Debug/VisualHTML', reportFiles: 'index.html', reportName: 'Visual Test Report - macOS'])
}
}
}
},
"Linux": {
node('linux') {
checkout poll: true, changelog: true, scm: scm
sh ("git clean -xdff")
sh ("bash -c 'Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config /xorg.conf :2 & echo \"\$!\" > xorg.pid'")
try {
sh ("mono Protobuild.exe --upgrade-all")
timeout(60) {
checkout poll: true, changelog: true, scm: scm
sh ("git clean -xdff")
sh ("bash -c 'Xorg -noreset +extension GLX +extension RANDR +extension RENDER -config /xorg.conf :2 & echo \"\$!\" > xorg.pid'")
try {
sh ("DISPLAY=:2 mono Protobuild.exe --automated-build")
stash includes: '*.nupkg', name: 'linux-packages'
sh ("mono Protobuild.exe --upgrade-all")
try {
sh ("DISPLAY=:2 mono Protobuild.exe --automated-build")
stash includes: '*.nupkg', name: 'linux-packages'
} finally {
sh ("if [ -e xorg.pid ]; then kill \$(<xorg.pid); fi")
}
} finally {
sh ("if [ -e xorg.pid ]; then kill \$(<xorg.pid); fi")
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'Protogame.Tests/bin/Linux/AnyCPU/Debug/VisualHTML', reportFiles: 'index.html', reportName: 'Visual Test Report - Linux'])
}
} finally {
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'Protogame.Tests/bin/Linux/AnyCPU/Debug/VisualHTML', reportFiles: 'index.html', reportName: 'Visual Test Report - Linux'])
}
}
}
Expand All @@ -54,12 +60,14 @@ stage("Package") {
node('windows') {
// Ensure a seperate working directory to the normal linux node above.
ws {
checkout poll: true, changelog: true, scm: scm
if (fileExists('unified.build')) {
unstash 'windows-packages'
unstash 'mac-packages'
unstash 'linux-packages'
bat ("Protobuild.exe --automated-build unified.build")
timeout(60) {
checkout poll: true, changelog: true, scm: scm
if (fileExists('unified.build')) {
unstash 'windows-packages'
unstash 'mac-packages'
unstash 'linux-packages'
bat ("Protobuild.exe --automated-build unified.build")
}
}
}
}
Expand Down

0 comments on commit 09c7b4f

Please sign in to comment.