-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
35 lines (32 loc) · 890 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
stages:
- cleanup
.artifacts-cleanup:
stage: cleanup
image:
name: ghcr.io/kilianpaquier/gitlab-storage-cleaner
entrypoint: [""]
needs: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: manual
variables:
GITLAB_TOKEN: <your_gitlab_access_token>
PATHS: ^$CI_PROJECT_NAMESPACE\/.*$ # regexp matching
THRESHOLD_DURATION: 168h
script:
- /app/gitlab-storage-cleaner artifacts \
--token "$GITLAB_TOKEN" \
--server "$CI_SERVER_HOST" \
--paths "$PATHS" \
--threshold-duration "$THRESHOLD_DURATION" \
--dry-run
artifacts-cleanup:dry-run:
extends: .artifacts-cleanup
artifacts-cleanup:
extends: .artifacts-cleanup
script:
- /app/gitlab-storage-cleaner artifacts \
--token "$GITLAB_TOKEN" \
--server "$CI_SERVER_HOST" \
--paths "$PATHS" \
--threshold-duration "$THRESHOLD_DURATION"