Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delaying post-build Jenkins job

Tags:

I have a Jenkins job which compiles and publishes our Java project to a JBoss server. Obviously, the server takes time to start and deploy the new code. I have a second Jenkins job that runs Selenium tests against the running JBoss instance.

I would like to make the second (Selenium) job be performed automatically as a post-build action from the first job (I have already done this), but I want it to be delayed by, say, 2 minutes. The amount of delay time isn't important, but I can't find anywhere that describes how to delay the start of a post-build job. How would I accomplish this?

like image 653
Mike Avatar asked Mar 01 '12 17:03

Mike


People also ask

How do I add a quiet period in Jenkins?

Step 1: Go to the Configure system page and set the time period that you want to set a Quiet period like in the below image. After putting time, click on the Save button. Step 2: Now run any job by clicking on the Build Now link twice.

What is quiet period in Jenkins?

Quiet Period: Quiet Period is the number of seconds that this Jenkins instance should be should wait before triggering a Job. The quiet period is important because suppose your job is auto-scheduled to run at some particular time, or the job can be triggered as soon they take place.


1 Answers

In the advanced project options of a project configuration, you can set a "quiet period" that does exactly that. Jenkins will wait the specified amount of time after a build has been triggered before actually starting the build.

Alternatively, you could have the JBoss server trigger the build (e.g. by calling a URL) once it's up and running. The advantage of that is what it would take care of cases where the JBoss server doesn't start for some reason.

You might also want to have a look at the Parameterized Trigger Plugin which allows you to run builds of other projects as build steps. This way you could run the Selenium tests as part of the original job and fail if those tests fail.

like image 61
Lars Kotthoff Avatar answered Oct 11 '22 16:10

Lars Kotthoff