Hello everyone,
I have been trying to get Pipelines to work with caching, but I have not succeeded yet.
The cache is supposed to be built after a succesful pipelines, but it does not do that.
And everytime I run the pipelines again (with or without a new commit), it says:Cache "composer": Downloading
Cache
"composer": Not foundCache "node": Downloading
Cache
"node": Not found
And I can't seem to figure out what I am doing wrong here.
This is my configuration:
image: awhalen/docker-php-composer-node pipelines: custom: Deploy to Acceptance: - step: deployment: staging script: - cd .. - rsync -vIauz --filter="merge build/filter.txt" build/ $ACC_USER@$ACC_HOST:$ACC_PATH Build & Deploy to Acceptance: - step: caches: - composer - node deployment: staging script: - cd pattern_lab - composer install - npm install - npm run build - cd ../.. - rsync -vIauz --filter="merge build/filter.txt" build/ $ACC_USER@$ACC_HOST:$ACC_PATH
Can anyone tell me what I am doing wrong here? I've ran the pipeline more than 10 times and the cache ceases to excist
The problem was that the node_modules weren't in the root directory. So the standard cache definition of Pipelines couldn't find it.
Assigning a custom path solved the problem
How do you add a custom path ?
Do you add a command with the custom path or do you change where bitbucket looks for the cache?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can define caches with custom paths in the definitions section of your yml file:
definitions:
caches:
mycustomcache: vendor/bundle
https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arjan,
Is there anything in the "Build teardown" section of your log file?
Caches are limited to 1GB in size and if your artifacts exceed that the cache will not be created.
Another possibility if that your build is not configured to output to the default composer location: ~/.composer/cache
Can you please list the contents of this directory at the end of your build to assist in debugging?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which directory do you want the content from?
This is in the "Build teardown" section:Cache "composer": Skipping upload for empty cache
Cache "node": Skipping upload for empty cache
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "composer" cache is a default cache that is configured to cache everything in the ~/.composer/cache directory.
The log message you posted from the teardown section indicates that there are no files in that directory: Cache "composer": Skipping upload for empty cache
You can verify this by listing the contents of the ~/.composer/cache directory at the end of your build. If this is not the location where your dependencies are located then you can either configure your build to output to that location or define a custom cache for a different location. Please see https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html for details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found out what the problems were:
Composer: In my dockerimage there was a composer home
Node: The node_modules weren't in the root
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.