Possible in Jenkins to add sleep time between build actions?

与世无争的帅哥 提交于 2019-12-08 17:30:32

问题


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?


回答1:


You can add sleep command (on Unix) in the test build action before test execution.




回答2:


If you mean to know how to sleep between those build steps you can use sleep with Execute shell type.

sleep 30s



回答3:


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)



回答4:


I just added a Powershell step to run script with Start-Sleep -sec 240




回答5:


all previous answers are correct, here is more detailed info for linux envirnment.

  1. Search you existing Job Configuration for "Add build step"

  2. Select Execute Shell and then add sleep some_number.



来源:https://stackoverflow.com/questions/13378185/possible-in-jenkins-to-add-sleep-time-between-build-actions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!