Skip to content

Commit

Permalink
use try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Nov 21, 2018
1 parent e3d96c9 commit c5680cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,23 @@ node('windows') {

stage 'Build'

def status = powershell(returnStatus: true, script: '& ./bin/windows/rebuild.ps1 > ./debug')
try{
powershell(returnStatus: true, script: '& ./bin/windows/rebuild.ps1 > ./debug')
} catch(error) {
def error_details = readFile('./debug');
def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
powershell(returnStatus: true, script: 'Remove-Item -Force ./debug')
handleError(message)
}
/*def status = powershell(returnStatus: true, script: '& ./bin/windows/rebuild.ps1 > ./debug')
if (status == 0) {
echo "build success"
} else {
def error_details = readFile('./debug');
def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
handleError(message)
powershell(returnStatus: true, script: 'Remove-Item -Force ./debug')
}
}*/

// stage 'Test'

Expand Down

0 comments on commit c5680cc

Please sign in to comment.