summaryrefslogtreecommitdiff
path: root/Gitlab CI job artifacts.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-06-16 10:44:49 +0200
committerJasper Ras <jras@hostnet.nl>2025-06-16 10:44:49 +0200
commit0d389e1d6c1aed4a92f82d9711f4564a12390fcd (patch)
treeca4925547669a045d836c2aeb6d4b2309c3f5996 /Gitlab CI job artifacts.md
parent32422d2b9001291d7136036581122cf4b4eec75c (diff)
vault backup: 2025-06-16 10:44:49
Diffstat (limited to 'Gitlab CI job artifacts.md')
-rw-r--r--Gitlab CI job artifacts.md40
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