Run jobs in sequence in one agent

19 views
Skip to first unread message

Alexandros Karypidis

unread,
Oct 10, 2017, 5:24:03 AM10/10/17
to Jenkins Users
Hello,

I have 2 jobs A and B. When B runs, it uses the (Jenkins Parameterized Trigger plugin) to trigger A to run and blocks until A finishes.

The problem is that I have 3 agents with 1 executors each and the result is that A and B usually run on different agents.

I would like to somehow achieve the following:

1) If I trigger B it should be able to pick any available agent and run there.
2) When B triggers A and waits for it, I would like A to run on the SAME agent as B.

I noticed that if I restrict A and B to a specific agent, the system "deadlocks" as A waiting for that agent which is occupied by B.

I guess what I am after is a way to chain jobs A and B into a sequence that runs on the same agent as a production line. B does not have to be active when A runs, only after A has finished.

Thanks

Alexandros Karypidis

unread,
Oct 10, 2017, 6:13:40 AM10/10/17
to Jenkins Users
To further clarify: Job A takes 30 minutes and job B another 30 minutes. They tie up both agents for the first 15 minutes for no reason. Now B depends on A (A uploads artifacts to a Nexus that B uses). So the truth is that I don't really mind if they run on the same agent or not (B will find A's output no matter what). What I really want is for B not to tie up an agent while it is waiting on A...
Reply all
Reply to author
Forward
0 new messages