views:

29

answers:

1

I have a job NIGHTLY that runs one time each night by a periodical timer.
Now I want to change so that the NIGHTLY job is only run if the last execution of another job FOO in Hudson is successful.

Note:

  • Job FOO is run many times each day and is triggered by SCM.
  • NIGHTLY should only be run one time per night and at a specific time.

Currently I have another job NIGHTLY_TRIGGER that runs a bash script that access the remote API of job FOO to check if job FOO is successful and if so triggers the NIGHTLY job.

Are there a nicer/cleaner way to do this? (preferable by using some Hudson plugins)

A: 

You could check out the Hudson Join Plugin which is made for this kind of scenario (wait for the conclusion of a job before executing another one).
The end result wouldn't be much different from what you are already doing, but this would be neatly parameterized:

alt text

So you would still have to check the status of FOO job, but at least you would check it right after FOO job completion.

VonC
I'm sorry, but I don't see how this would solve the problem. I want the NIGHTLY job to be run only once at a certain time each night triggered by a periodical timer and that the periodical timer would be blocked/canceled if the FOO job is not successful. Although it looks like a nice plugin =)
ki_
@ki_: could you make that periodical timer as a trigger for FOO? : if FOO fails ("unstable"), the timer won't run.
VonC
@VonC: What do you mean with that the "periodical timer" should be a trigger for FOO? I don't want to schedule FOO to run every night.
ki_
@ki_: right, I understand better now. And I am not sure there is a better way than controlling your NIGHTLY_BUILD job execution through the remote API.
VonC

related questions