diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2022-06-21 13:36:08 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2022-06-21 13:36:08 +0300 |
commit | 32c8b81d90846b8373d672b69f01c07c911c40c8 (patch) | |
tree | 252bf3379adbec2d7bbd5c272531fffadbba8185 | |
parent | 4f460bdc6fbcabaafa0cd5c51ec4997c28a6d792 (diff) | |
parent | 3d344870d3e84e80ee88d30274365d4df235b3cd (diff) |
Merge branch 'docs-delete-stopped-envs-automatically' into 'main'
Add job to delete old stopped environments
Closes #1205
See merge request gitlab-org/gitlab-docs!2847
-rw-r--r-- | .gitlab-ci.yml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3330ba6a..f051e457 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -530,6 +530,22 @@ clean-pages: - nginx - review-apps +# +# Clean up stopped review app environments. Only done in chores pipeline, +# only deletes stopped environments that are over 30 days old. +# +delete_stopped_environments: + image: alpine:latest + needs: [] + before_script: [] + dependencies: [] + extends: + - .rules_chores + stage: test + script: + - apk --update add curl jq + - curl --request DELETE "https://gitlab.com/api/v4/projects/1794617/environments/review_apps?dry_run=false&private_token=$DELETE_ENVIRONMENTS_TOKEN" | jq + ############################################### # GitLab Pages (production) # ############################################### |