Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
 Thanks, but this approach is not working.
1)  junit 'res.xml'  will always report unstable ( I just can't get it to
report something else)
2) catch will not catch unstable build
3) I tried:
.
parallel(
"test1": {
node('master'){
bat 'exit 0'
bat 'type ei_result.xml > res.xml'
try {
   junit 'res.xml'
   if (currentBuild.result == 'UNSTABLE'){
currentBuild.result = 'SUCCESS'
}
} catch(err) {
throw(err)
}
}
},
"test2": {
  node('robot'){
echo "dfds"
}  ...

It's always ending up Yellow, as unstable


On Tue, Mar 28, 2017 at 7:59 PM,  wrote:

> This seem like a declarative way bug too me. I do this into full scripts
> (changing the current build result) and it work fine.
> I haven't tested the declarative (post {}, always {}, ...), but you could
> try a Jenkinsfile without the declarative syntax:
>
> node()
> {
> try
> {
>   // make you junit test that make unstable here
> }catch()
> {
> if (currentBuild.result == 'UNSTABLE')
> currentBuild.result = 'SUCCESS'
> }
> }
>
> This should work, if so, it mean that the declarative syntax have a bug in
> it and the currentBuild.result is somehow a copy used into the post scope
> and restore after the processing of the declarative post {}. You should
> open a bug report if so.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/c18bc05d-ba2e-44e5-8a0f-ffd2dd42e306%40googlegroups.
> com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKokUHBRdQ1LFPgc7WzPPojzz4hpFnMzjPX_%2BqW3Q%3DEu8jAbTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread jerome
This seem like a declarative way bug too me. I do this into full scripts 
(changing the current build result) and it work fine.
I haven't tested the declarative (post {}, always {}, ...), but you could 
try a Jenkinsfile without the declarative syntax:

node()
{
try
{
  // make you junit test that make unstable here
}catch()
{
if (currentBuild.result == 'UNSTABLE')
currentBuild.result = 'SUCCESS'
}
}

This should work, if so, it mean that the declarative syntax have a bug in 
it and the currentBuild.result is somehow a copy used into the post scope 
and restore after the processing of the declarative post {}. You should 
open a bug report if so.

-- 
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/c18bc05d-ba2e-44e5-8a0f-ffd2dd42e306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Jérôme Godbout
Setting stable is not an available enum value, so you fall back to FAILURE
I guess. If you set success, make sure you make it case sensitive

currentBuild.result = 'SUCCESS'


[image: bodycad] 
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely
for the addressee(s) and may contain confidential and/or privileged
information and may be legally protected from disclosure. If you are not
the intended recipient of this message or their agent, or if this message
has been addressed to you in error, please immediately alert the sender by
reply email and then delete this message and any attachments. If you are
not the intended recipient, you are hereby notified that any use,
dissemination, copying, or storage of this message or its attachments is
strictly prohibited.

Le contenu de ce message et les pièces jointes sont destinés uniquement
pour le(s) destinataire(s) et peuvent contenir des informations
confidentielles et / ou privilégiées qui peuvent être protégées légalement
contre toute divulgation. Si vous n'êtes pas le destinataire de ce message
ou son agent, ou si ce message vous a été adressé par erreur, s’il vous
plaît avertir immédiatement l'expéditeur par courriel de réponse, puis
supprimer ce message et les pièces jointes. Si vous n'êtes pas le
destinataire prévu, vous êtes par la présente informé que toute
utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces
jointes est strictement interdit.

On Tue, Mar 28, 2017 at 1:05 PM, Tomas Pekarovic 
wrote:

> Question is why when i set 'success' nothing happen. If I set 'stab'e, it
> will recolor all the pipeline steps to GREEN  and after that result of
> build is 'FAILURE'
>
> On Tue, Mar 28, 2017 at 6:52 PM,  wrote:
>
>> Take care the currentBuild.result will be unset if successful up to that
>> point. There's no 'STABLE'
>>
>> 'SUCCESS'
>> 'UNSTABLE'
>> 'FAILURE'
>> 'ABORTED'
>> 'NOT_BUILT'
>>
>> http://javadoc.jenkins-ci.org/hudson/model/Result.html
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/jenkinsci-users/81762c79-b462-4839-b7b3-13eea7ef884c%
>> 40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAKokUHCu0WEcTjCBKqg3-2Nd6%
> 3DRr1DkfeBQhaqkon5Gt-Rv2dw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKmu%2Be09e%3DuN9p%3DLg7sPR6efW%2B9gy%2B%3D%2By75KmVAgOcUdbWRF5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
Question is why when i set 'success' nothing happen. If I set 'stab'e, it
will recolor all the pipeline steps to GREEN  and after that result of
build is 'FAILURE'

On Tue, Mar 28, 2017 at 6:52 PM,  wrote:

> Take care the currentBuild.result will be unset if successful up to that
> point. There's no 'STABLE'
>
> 'SUCCESS'
> 'UNSTABLE'
> 'FAILURE'
> 'ABORTED'
> 'NOT_BUILT'
>
> http://javadoc.jenkins-ci.org/hudson/model/Result.html
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/81762c79-b462-4839-b7b3-13eea7ef884c%40googlegroups.
> com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKokUHCu0WEcTjCBKqg3-2Nd6%3DRr1DkfeBQhaqkon5Gt-Rv2dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread jerome
Take care the currentBuild.result will be unset if successful up to that 
point. There's no 'STABLE'

'SUCCESS'
'UNSTABLE'
'FAILURE'
'ABORTED'
'NOT_BUILT'

http://javadoc.jenkins-ci.org/hudson/model/Result.html

-- 
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/81762c79-b462-4839-b7b3-13eea7ef884c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
hmm.. great

thanks

On Tue, Mar 28, 2017 at 6:09 PM, Daniel Beck  wrote:

>
> > On 28.03.2017, at 15:18, Tomas Pekarovic  wrote:
> >
> > it seems to me as a bug.
>
> Works as intended and documented:
> http://javadoc.jenkins.io/hudson/model/Run.html#setResult%28hudson.model.
> Result%29
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/62100418-4F21-4EFB-B82F-66715256AE80%40beckweb.net.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKokUHD52%2BoUnn%2B-2T-JNANsZyU%2BsNX%3DhCf_-Fs9uorqMR9dHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Daniel Beck

> On 28.03.2017, at 15:18, Tomas Pekarovic  wrote:
> 
> it seems to me as a bug.

Works as intended and documented:
http://javadoc.jenkins.io/hudson/model/Run.html#setResult%28hudson.model.Result%29

-- 
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/62100418-4F21-4EFB-B82F-66715256AE80%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Richard Ginga
Tomas, I don't think you can set a job's resultant status Better than it
currently is. You can set it down. e.g. unstable->failure

On Tue, Mar 28, 2017 at 9:18 AM, Tomas Pekarovic  wrote:

> HI,
>
>  I have this post-buidl action:
>
> post {
> always {
> script {
> if (currentBuild.result == 'UNSTABLE'){
> currentBuild.result = 'STABLE'
> }
> currentBuild.result = 'SUCCESS'
> }
> }
> }
>
>
> All i need is just to set build to SUCCESS even if it is UNSTABLE.
>
> JUNIT step produces currentBuild.result = UNSTABLE  < this is ok..
>
> at the end I need to change status to succes. I tried all possible
> combinations.
> If I do:
>
> post {
> always {
> script {
> if (currentBuild.result == 'UNSTABLE'){
> currentBuild.result = 'SUCCESS'
> }
> }
> }
> }
>
> It does nothing and build is yellow
>
> If I do:
>
> post {
> always {
> script {
> if (currentBuild.result == 'UNSTABLE'){
> currentBuild.result = 'STABLE'
> }
> }
> }
> }
>
> All steps change to  green/blue  (that is correct) but overal build is
>  FAILURE
>
>
> I'm out of ideas and it seems to me as a bug.
>
> If I do nothing in postbuild full build is marked as  'UNSTABLE'
>
> thanks for any ideas
>
> --
> 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/f2eac395-838e-4421-b9b8-ec9a7308cc31%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Dick Ginga
Build Engineer
rgi...@disruptorbeam.com

-- 
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/CAL3PpaWLBkZQPWui_fCV-f5LgT46Cach1ojixN-sZi1L7wSs-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.