Set a deploy freeze from the API
Problem to solve
It would be useful for gitlab.com full CD deployments to be able to specify windows of time when runners are paused for an environment. This has different use cases, for example:
For a regularly scheduled cron like syntax | For ad-hoc windows |
---|---|
- For teams that are not global, not as relevant to GitLab, the ability to halt CICD deployments off-hours. - Suspend CICD pipelines on weekends when there is limited team availability. |
- Special events such as big announcements, livestreams, etc. - Holidays where there is limited team availability. |
Intended users
Proposal
This is the Backend-only MVC for Deploy Freeze for environments.
-
Deploy freeze periods are specified using
cron
format, and managed via API. No UI is delivered in this MVC. -
If a job is being processed during a freeze period, the
CI_DEPLOY_FREEZE
CI variable is set -
Jobs which should respect the freeze period are specified with a rule, for example:
deploy_to_production:
stage: deploy
script: deploy_to_prod.sh
rules:
- if: $CI_ENVIRONMENT_FROZEN == null
-
In this iteration there is no error or message, the job simply does not get created.
-
The entire pipeline must be restarted if the freeze period is over and the job should now run.
Relates to #24295 (closed)
Permissions and Security
Only Maintainer
users will be able to interact with the API endpoints.