I am trying to use the caches key option to create a custom dependency cache with file checksum-based hashing according these examples:
https://support.atlassian.com/bitbucket-cloud/docs/cache-and-service-container-definitions/#Caches
https://bitbucket.org/blog/announcing-smarter-caches-bitbucket-pipelines
definitions:
caches:
pip: ~/.cache/pip
virtualenv: venv
proxies: $BITBUCKET_CLONE_DIR/artifacts/proxies
googleapi:
path: services/google_api/dependencies
key:
files: [ $BITBUCKET_CLONE_DIR/services/google_api/dependencies/dependency.json ]
however the step always fails with error:
Cache "googleapi: services/google_api/dependencies": Cache key files could not be found.
HOW to solve this issue? Tried different options to provide different format paths for the `path` variable
It works ONLY in this way:
definitions:
caches:
pip: ~/.cache/pip
virtualenv: venv
proxies: $BITBUCKET_CLONE_DIR/artifacts/proxies
googleapi: $BITBUCKET_CLONE_DIR/services/google_api/dependencies
Hi @etreskovskis and welcome to the community!
I believe the issue is that you're using an absolute path for the key file. Cache directory paths can be absolute, or relative to the clone directory, but the path to the key files needs to be relative to the clone directory.
Could you try the following definition?
definitions:
caches:
pip: ~/.cache/pip
virtualenv: venv
proxies: $BITBUCKET_CLONE_DIR/artifacts/proxies
googleapi:
path: services/google_api/dependencies
key:
files: [ services/google_api/dependencies/dependency.json ]
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to hear, thank you for the update! Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.