Clearing The Pipeline Cache With Gitlab CI
Answer :
It's not a perfect solution, but we ended up creating a cleanup job at the end of our .gitlab-ci.yaml
file that deletes the cache directory from the filesystem.
This way, each pipeline gets its own unique cache, without cluttering up the file system over time.
cleanup_job: stage: cleanup script: - echo "Cleaning up" - rm -rf "%CACHE_PATH%/%CI_PIPELINE_ID%" when: always
where
CACHE_PATH: "C:/gitlab-runner/cache/group/project/repo/"
Comments
Post a Comment