Re: pipeline multi branch, how to continue if error occures

2016-09-12 Thread Sverre Moe
Either get return code from the executing shell script or surround with 
try-catch

final def returnCode = sh returnStatus: true, script: ""
if (returnCode != 0) {

}

try {
sh ""
} catch (e) {

}

tirsdag 13. september 2016 04.10.57 UTC+2 skrev R Tyler Croy følgende:
>
> (replies inline) 
>
> On Mon, 12 Sep 2016, Klaus Rudolph wrote: 
>
> > Hi all, 
> > 
> > if I use gtest in pipeline setup and have a unit test which fails the 
> groovy script stops. 
> > 
> > How can I tell the script that I want to continue so that I am able to 
> see the results from xunit/gtest plugin? 
> > 
> > From the gui without running Jenkinsfile there I had to write "set +e" 
> in the dialog box, but I don't know how to write that in groovy. 
>
>
> If the issue is just a single `sh` command return a non-zero exit code, 
> then 
> you can avoid that with: 
>
> sh './test-runner.sh || true' 
>
>
> - R. Tyler Croy 
>
> -- 
>  Code:  
>   Chatter:  
>
>   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F 
> -- 
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d50489e1-b189-4139-921a-fe2d2e2ff1c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline multi branch, how to continue if error occures

2016-09-12 Thread R. Tyler Croy
(replies inline)

On Mon, 12 Sep 2016, Klaus Rudolph wrote:

> Hi all,
> 
> if I use gtest in pipeline setup and have a unit test which fails the groovy 
> script stops.
> 
> How can I tell the script that I want to continue so that I am able to see 
> the results from xunit/gtest plugin?
> 
> From the gui without running Jenkinsfile there I had to write "set +e" in the 
> dialog box, but I don't know how to write that in groovy.


If the issue is just a single `sh` command return a non-zero exit code, then
you can avoid that with:

sh './test-runner.sh || true'


- R. Tyler Croy

--
 Code: 
  Chatter: 

  % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
--

-- 
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 on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/20160913021041.GP18556%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature