diff options
Diffstat (limited to 'Gitlab CI job artifacts.md')
-rw-r--r-- | Gitlab CI job artifacts.md | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Gitlab CI job artifacts.md b/Gitlab CI job artifacts.md new file mode 100644 index 0000000..97b05d5 --- /dev/null +++ b/Gitlab CI job artifacts.md @@ -0,0 +1,40 @@ +[Job artifacts](https://docs.gitlab.com/ci/jobs/job_artifacts/) + +--- +# Creation +Expose via +``` +artifacts: + path: + - blaat.txt +``` + > path is relative to repository where job was created + + Wildcards can be used: `*` in the path. + Expiry can be set, ie: `expire_in: 1 week`. +`artifacts: name` to explicitly name the artifact. +# Using +Artifacts are downloaded into the job's working directory by default. If one specifies either: `dependencies` or `needs` only artifacts of jobs of those are downloaded. +`dependencies` only specifies which artifacts to download whereas `needs` also defined the relationship between jobs. +To prevent downloading dependencies at all just set `dependencies: []`. + +Example: +``` +dependencies: + - build-gobs + - build-goba +``` + +They can also be downloaded over http. Using the job token is allowed. +```plaintext +https://gitlab.com/api/v4/projects/<project-id>/jobs/artifacts/main/download?job=build +``` + +``` +build_submodule: + stage: test + script: + - apt update && apt install -y unzip + - curl --location --output artifacts.zip "https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/main/download?job=test&job_token=$CI_JOB_TOKEN" + - unzip artifacts.zip +```
\ No newline at end of file |