needs
creates dependencies between jobs in a pipeline so that jobs run as soon as their dependencies are met, regardless of the pipeline's stagesstages configuration.
artifacts
is used to specify which files to saveartifacts: when
:
on_success
: upload artifacts when the job succeeds (default)on_failure
: upload artifacts when the job failsalways
: always upload artifacts, whatever the job succeeds / fails (except if it times out)dependencies
and needs
job:
artifacts:
paths: relative to the project directory: $CI_PROJECT_DIR
- binaries/
- .config
this creates an artifact with .config and all the files in binaries
whenhas been somewhat misleading to me, since
type, which is one of (i.e. the corresponding job runs...) :
on_success
/ on_failure
of previous jobsalways
/ never
manual
ly (as a manual job)when: on_success
myJob: stage: when: keyword
rules:changes
specifies that a job will only be added to a pipeline when specific files (specified as subkeys) are changedrules:changes:paths
is a synonymous of rules:changes
(unclear why it exists, then. Possibly a legacy 🤷♀️)changes: pathSpec
OR
within files listed by pathSpecchanges
evaluates to true
for any change in the repositoryrules: conditions
statement
is true, add the job to the pipelinestatement
is true but it's combined with when: never
: do not add the job to the pipelinestatement
is false, check the next rules
item (if any)pathSpec
exists, add the job to the pipelineadding a job to a pipeline/
NOT adding a job to a pipeline/
running a job: