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 Subject: Re: Declarative script: 'bat' command fails but job succeeds Not sure about declarative p

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: https://jenkins.io/doc/pip

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 r

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 discus

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 i

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') { ag

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 jenkinsci-users+unsubscr...@googlegroups.com.

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 discussion

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

2017-10-18 Thread David Aldrich
7 10:45 To: jenkinsci-users@googlegroups.com Subject: [** SUSPICIOUS EMAIL **] Declarative script: 'bat' command fails but job succeeds Hi I have a declarative script that runs a ‘bat’ step. That step builds some VS Studio projects on a Windows slave by calling msbuild: steps {

Declarative script: 'bat' command fails but job succeeds

2017-10-18 Thread David Aldrich
Hi I have a declarative script that runs a 'bat' step. That step builds some VS Studio projects on a Windows slave by calling msbuild: steps { bat ''' call "%VSMSBUILDCMD%" msbuild %WORKSPACE%\\MSVC\\ /p:Configuration=config_0