I am starting a JBoss server in Jenkins as a build action. The next action runs a set of tests. I need to add sleeptime between the two actions. Does anyone know how to do this easily?
Global configurationGo to Manage Jenkins and then Configure System . Under the item Global Build Time Out you can activate a global timeout which will be applied to any job. Choose your timeout strategy, the duration and add actions which should be executed at timeout.
There is a "Quiet Period" option in the Advanced Project Options available. You can enter a value of 300 (its in seconds) to delay the start of the job by 5 mins. Update: now this Quiet Period option is a check box in Build Triggers option.
There is a built-in feature in Jenkins to put a sleep but it is not easy to find it because they call it differently. You can see there is a Quiet period setting in the advanced project options that is "executed" before the current job (project).
What is the Quiet period configuration in Jenkins? When this option is non-zero, newly triggered builds of this project will be added to the queue, but Jenkins will wait for the specified period of time (in seconds ) before actually starting the build.
It is possible to use sleep
step in your Jenkins Pipeline. The step is included in Pipeline: Basic Steps.
Example:
steps {
sleep time: 250, unit: 'MILLISECONDS'
}
You can add sleep
command (on Unix) in the test build action before test execution.
There is a built-in feature in Jenkins to put a sleep but it is not easy to find it because they call it differently.
On the following screenshot
You can see there is a Quiet period
setting in the advanced project options that is "executed" before the current job (project).
If you have 3 jobs you can as well set this setting for jobs 2 and 3 which will make:
job1 -> (sleep -> job2) -> (sleep -> job3)
all previous answers are correct, here is more detailed info for linux envirnment.
Search you existing Job Configuration for "Add build step"
Select Execute Shell and then add sleep some_number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With