Agent label conditional

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Agent label conditional

Alex Panayi
Hey guys.

I have a step where i want to conditionally pick the agent based on the parameter. 

I can easily do this by duplicating the step, and having a when statement, but this creates step duplication. I just want the agent label to be dynamically changed based on a parameter.


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6ed5e088-55f8-4edc-8eae-8b02abe8566fn%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Agent label conditional

Baptiste MATHUS
Using Jenkins pipeline, simply use the parameters inside the agent label specification and it will do exactly this.

(Note: Not 100% sure declarative pipelines support variables, but cannot check right now)

Le lun. 27 juil. 2020 à 19:09, Alex Panayi <[hidden email]> a écrit :
Hey guys.

I have a step where i want to conditionally pick the agent based on the parameter. 

I can easily do this by duplicating the step, and having a when statement, but this creates step duplication. I just want the agent label to be dynamically changed based on a parameter.


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6ed5e088-55f8-4edc-8eae-8b02abe8566fn%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS7U0Xh50kee%3DGX0o6%3D%3DwXbOcABAjdZcpwf1aBOfY10f3A%40mail.gmail.com.