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/pipvirtualenv: venvproxies: $BITBUCKET_CLONE_DIR/artifacts/proxiesgoogleapi:path: services/google_api/dependencieskey: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` variableIt works ONLY in this way:
definitions:caches:pip: ~/.cache/pipvirtualenv: venvproxies: $BITBUCKET_CLONE_DIR/artifacts/proxiesgoogleapi: $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
Great! It worked!!!
That's good to hear, thank you for the update! Please feel free to reach out if you ever need anything else!
It looks like you're new here. Sign in or register to get started.