Re: [Declarative Pipeline] currentBuild.result is not set

2017-02-11 Thread Dan Tran
Thanks that helps

-Dan

On Saturday, February 11, 2017 at 10:42:02 PM UTC-8, Andrew Bayer wrote:
>
> Yup - currentBuild.result isn't actually set until either something is 
> explicitly setting the status (like a failure or unstable) or the build 
> ends, at which point it's set to success if still null. So basically null 
> is equivalent to success.
>
> A.
>
> On Sat, Feb 11, 2017 at 9:49 AM Dan Tran  
> wrote:
>
>>
>> Hi
>>
>> It seems currentBuild.result is not set at post stages, here is the 
>> snippet. is it normal?  it always return null for my case
>>
>>stages {
>>   ...
>> }
>>
>> post {
>>
>> always {
>> script {
>>wrap([$class: 'BuildUser']) {
>>   mail to: "${env.BUILD_USER_EMAIL}",
>>   subject: "${env.BUILD_URL} 
>> ${currentBuild.result}",
>>   body: "${env.BUILD_URL} completed"
>>}
>>}
>> }
>>
>> }
>>
>> Thanks
>>
>> -Dan
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/ce8101b2-6a0b-4581-a39b-5b831339d62f%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/89963e6f-2f5e-4926-afdb-477758f12bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative Pipeline] currentBuild.result is not set

2017-02-11 Thread Andrew Bayer
Yup - currentBuild.result isn't actually set until either something is
explicitly setting the status (like a failure or unstable) or the build
ends, at which point it's set to success if still null. So basically null
is equivalent to success.

A.

On Sat, Feb 11, 2017 at 9:49 AM Dan Tran  wrote:

>
> Hi
>
> It seems currentBuild.result is not set at post stages, here is the
> snippet. is it normal?  it always return null for my case
>
>stages {
>   ...
> }
>
> post {
>
> always {
> script {
>wrap([$class: 'BuildUser']) {
>   mail to: "${env.BUILD_USER_EMAIL}",
>   subject: "${env.BUILD_URL}
> ${currentBuild.result}",
>   body: "${env.BUILD_URL} completed"
>}
>}
> }
>
> }
>
> Thanks
>
> -Dan
>
> --
> 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/ce8101b2-6a0b-4581-a39b-5b831339d62f%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/CAPbPdOaY5mpuqznq7nLTPnkm6t_7JEtfoa4iNaNVGkH%3Dp1eKiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Declarative Pipeline] currentBuild.result is not set

2017-02-11 Thread Dan Tran

Hi

It seems currentBuild.result is not set at post stages, here is the 
snippet. is it normal?  it always return null for my case

   stages {
  ...
}

post {

always {
script {
   wrap([$class: 'BuildUser']) {
  mail to: "${env.BUILD_USER_EMAIL}",
  subject: "${env.BUILD_URL} 
${currentBuild.result}",
  body: "${env.BUILD_URL} completed"
   }
   }
}

}

Thanks

-Dan

-- 
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/ce8101b2-6a0b-4581-a39b-5b831339d62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.