We have many jenkins tasks that process some data, depending on the date, for example, accumulations per hour, per day.
All of them are configured for periodic execution, but native Jenkins cannot automatically start automatic periodic work with dynamic parameters, and we must calculate the required parameters inside the script at runtime, for example, in the bash script code:
PREVHOUR=$(date --date="-1 hour" "+%Y-%m-%d %H")
We can also use the $ BUILD_ID environment variable to get the build start time.
The problem is this: When all the slots (workers) are busy, Jenkins puts this work in line . And the calculation of the parameters will be incorrect if such a task is performed the next hour after launch.
Thus, we cannot find a way to get the TRIGGER time , and not build a start time.
Of course, there are several inconvenient solutions:
- start simple periodic work on a reserved machine, which starts other tasks by URL with parameters
- which tracks the last execution time of the script
We tried to find plugins that would suit our needs, and found this plugin , but it only works in manual mode (UI "build now" click).
Is there any plug-in for Jenkins to calculate dynamic parameters during periodic startup?
Thanks!
source share