Skip to content

Commit

Permalink
powershell mod to Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Nov 21, 2018
1 parent ee38d71 commit 647aa7b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ node('windows') {

stage 'Build'

try{
bat 'powershell ./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}"
bat "powershell (Remove-Item -Force ./debug)"
handleError(message)
def status = powershell(returnStatus: true, script: './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 647aa7b

Please sign in to comment.