pipeline select agent depending on avaliability

46 views
Skip to first unread message

Rita Morgan

unread,
Aug 17, 2022, 1:37:06 PM8/17/22
to Jenkins Users
Using a Jenkinsfile, I have 2 agents (master, nodeA). 

I prefer my job to run on nodeA. If its not available (its a ec2 instance), i want it to run on master. 

Is there a way to declare this in a pipeline? I know there is a feature to prefer an agent or explicity set it as a label but I really want the logic to be in a pipeline. 

Yamuna

unread,
Aug 20, 2022, 10:43:41 AM8/20/22
to jenkins...@googlegroups.com
Hi 

   Can you try checking it’s online or not and then try again.

Ex: Jenkins.instance.getNode('my-node').toComputer().isOnline()

I am not sure. Just a suggestion. 

--
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/ec7bccba-4698-4ce3-9c07-4cb19100d156n%40googlegroups.com.
--
Thanks & Regards
Yamuna Devi

Christopher Dean

unread,
Nov 27, 2024, 8:22:17 PM11/27/24
to Jenkins Users
WELDING MACHINES AND ACCESSORIES FOR SALE ONLINE WITH SAFE AND GUARANTEED SHIPPING.


SHOP BELOW

Buy discounted welders, plasma cutters and welding safety gear by premium brands like Miller, Lincoln Electric, Hypertherm, Hobart and Black Stallion - from the mouse with over 86 years of welding experience.

where to order welding machines and accessories online with safe shipping.

we have the best welding tools like reels,miller remote,pipe bender,welding cable, lincoln rods,leads,miller welding helmet,mig guns,tig torches,plasma torches,welding cables,mig welders,tig welders,Etc.

Order now from our website below with safe and guaranteed shipping

Reply all
Reply to author
Forward
0 new messages