Agent label conditional

16 views
Skip to first unread message

Alex Panayi

unread,
Jul 27, 2020, 1:08:46 PM7/27/20
to Jenkins Users
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.


Baptiste Mathus

unread,
Aug 13, 2020, 5:39:36 AM8/13/20
to jenkins...@googlegroups.com
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)

--
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/6ed5e088-55f8-4edc-8eae-8b02abe8566fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages