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