Transfer files between jobs using artifacts
All jobs in subsequent stages will receive the artifacts (by default)
Name artifacts
Include and exclude paths
When to create artifacts (jobs success, failure, always)
Expire artifacts
Add untracked files
Jobs can restrict which job artifacts to receive
job_name:
dependencies:
- other_job
#...
Empty list disables receiving artifacts:
job_name:
dependencies: []
#...
Passing variables between jobs is possible (since GitLab 12.9)
One job defined a dotenv
artifact :
job_name:
script: echo "FOO=bar" >build.env
artifacts:
reports:
dotenv: build.env
Job in later stages automatically consume them:
job_name2:
script: echo "${FOO}"
dependencies
limits from which jobs artifacts are consumed
See chapter Artifacts
By default, artifacts can not be larger tham 100MB
Can be configured…
When two jobs produce an artifact with the same name…
…the last job to finish wins
Defaults to keep artifacts from most recent successful jobs
If enabled, expire_in
does not apply to most recent artifacts