Is it possible to invalidate or clear the pipeline cache using Gitlab CI after pipeline completion?
My .gitlab-ci.yml
file has the following global cache definition
cache:
key: "%CI_PIPELINE_ID%"
paths:
- './msvc/Project1`/bin/Debug'
- './msvc/Project2`/bin/Debug'
- './msvc/Project3`/bin/Debug'
The value cache-key
indicates that each pipeline should support its own cache, which works fine, but the cache file continues to exist after the pipeline finishes. With the launch of hundreds of pipelines, the size begins to take shape and manually deleting the cache folder on our machine is not a great solution.
I tried adding a cleaning job at the end of the pipeline
cleanup:
stage: cleanup
script:
- rm -rf './msvc/Project1/bin'
- rm -rf './msvc/Project2/bin'
- rm -rf './msvc/Project3/bin'
when: always
which deletes local files but does not delete them from the cache.
Am I missing something?
Gitlab-EE 10.3.3 is currently running.
Dan q source
share