I want to share a file between two jobs and modify it if there are changed files. The python script compare the cache.json
file with changes and modify the cahce file sometimes.
.gitlab-ci.yaml
:
image: ubuntu
stages:
- test
cache:
key: one-cache
paths:
- cache.json
job1:
stage: test
script:
# - touch cache.json
- cat cache.json
- python3 modify_json_file.py
- cat cache.json
The problem is that it the cache.json
file not exist at the next job run. I get the error message: cat: cache.json: No such file or directory
. I did also insert once the touch command, but this doesn't change anything for the next run without the touch command.
Do I something wrong or don't I understand the cache
at gitlab wrong.