Комментарии:
Thanks, I was looking for this exact thing.
ОтветитьVery helpful thanks
Ответитьplease note that in declarative pipeline, all variables defined with def cannot be accessed by any method defined in the same script, they can only be accesed directly inside the pipeline {} block, if you need to define variables and use them in methods, you will have to define them as global i.e. without def or annotate them with @Field annotations to declare them as script class members.
ОтветитьIs it possible to do this using Shared Libraries?
ОтветитьSimple and easy way to Learn Jenkins... Thanks for sharing 😊
ОтветитьWhat I did was I declared a variable def animal = my script' and assigned it to a global environment variable so that I can use in other stages.
env.ANIMAL = animal