How to setting up a job that can only be executed when the pipeline has been scheduled (or the opposite)?
Example in documentation: candidate for deprecation?
source : https://gitlab.adullact.net/help/ci/pipelines/schedules#using-only-and-except
To configure that a job can be executed only when the pipeline has been scheduled (or the opposite), you can use only and except configuration keywords.
For example:
job:on-schedule: only: - schedules script: - make world job: except: - schedules script: - make build
"only" and "except" configuration keywords
source: https://gitlab.adullact.net/help/ci/yaml/README.md#onlyexcept-basic
NOTE: Note: The
rules
syntax is now the preferred method of setting job policies.only
andexcept
are candidates for deprecation, and may be removed in the future.
new way: rules syntax
source: https://gitlab.adullact.net/help/ci/yaml/README.md#rules
rules
allows for a list of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job. Note thatrules
cannot be used in combination withonly/except
since it is intended to replace that functionality
- What is the correct method for setting up a job that can only be executed when the pipeline has been scheduled (or vice versa)?
- Has anyone ever done it with the new syntax?