Just inside the squiggle braces, set a variable.

stage("Stage1"){
> def current_stage = "Stage1"

echo "I'm in stage: $current_stage"
> }


On Thu, Nov 3, 2016 at 4:17 AM, Ron Keidar <ronkeida...@gmail.com> wrote:

> Hi
> I'm writing a new Jenkins function and I would like to get the current
> stage name that is running right now on the pipeline.
> for example:
>
>
> stage("Stage1"){
>     def current_stage = getCurrentStageName()
>     echo "I'm in satage: $current_stage"
>
> }
>
> --
> 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/89c43598-1d80-475b-b7cb-9bc3759b2ec7%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/89c43598-1d80-475b-b7cb-9bc3759b2ec7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.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/CAA4vtDRUp6nuFGAZbmPAnUmruF64QxY2AD914tXZc4%3DdgAJEbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to