RE: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread David Aldrich
Thanks for your answer. From: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] On Behalf Of jer...@bodycad.com Sent: 19 October 2017 15:36 To: Jenkins Users <jenkinsci-users@googlegroups.com> Subject: Re: Declarative script: 'bat' command fails but job su

Re: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread jerome
Not sure about declarative pipeline (I haven't played with them yet). but for normal pipeline I use it this way: bat returnStatus: false, script: "\"${bcad.msbuild_current}\" ${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build" You can find the doc here:

RE: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread David Aldrich
Thanks very much for your reply. > Take care batch error level only is valid for the last command and not a > cumulative flag. Yes, that was exactly the issue. I followed your advice and the script works correctly now. > Also make sure you give the proper  bat argument returnStatus into your

Re: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread jerome
Take care batch error level only is valid for the last command and not a cumulative flag. So every msbuild command you run should check the error level result and exit batch according to it with proper error code. This will make the bat command failed properly. I personnaly would suggest, you

RE: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread David Aldrich
Yes, that’s right. Sorry for using wrong term. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this

Re: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread itchymuzzle
So you don't mean "script", you mean using "bat" as you would "sh". Is that right? stage('Build') { steps { script { -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from

RE: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread David Aldrich
Here’s a better view of my script: pipeline { agent none options { buildDiscarder(logRotator(numToKeepStr: '20')) } triggers { pollSCM('H/5 * * * *') } stages { stage('build_gcc') { } stage('build_VisualStudio') {

Re: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread itchymuzzle
>bat ''' What type of quote(s) is that? Three single quotes? -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread itchymuzzle
Where is "script" in the original example? -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this

RE: Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread David Aldrich
A follow-up to this: I ran the failing msbuild command from the command line (in the workspace) and checked the errorlevel, it was 1. I then replayed the declarative script with some extra code: msbuild %WORKSPACE%\\MSVC\\ /p:Configuration=config_2 /p:Platform="Win32"