I have a requirement to only allow deployments to production in a specific time range, e.g.: between 04:00 and 06:00.
My Jenkins pipeline is triggered by a Git webhook and starts a flow consisting of the usual stages (Build, Test, Deploy Dev, Deploy Pre, Deploy Pro).
When we reach the Deploy Pro stage I would need to check whether the current time is in the allows range to go on. Otherwise I need to pause the pipeline (freeing the Jenkins agent) until that time range is reached.
Is is possible to implement this? How?