I've been using the node cache feature for some time now and have been using yarn to load my load modules with the following pipeline snippet:
- yarn install
Observing the performance over several pipelines I haven't noticed any reduction in load time. I'm aware that the cache may not trigger for every pipeline, but I wanted to know if using yarn instead of npm is currently supported or is planned to be supported by pipelines caching.
I can't reply for Shane, but I am following the same process outlined in the doc you linked to, but am not seeing any benefits either. I believe I used to before but it's been a while since I noticed no benefits. At this time, my `yarn install`s take over half a minute despite the cache.
Incidentally, at the bottom I see `Cache "node": Skipping upload for previously downloaded cache`
I think these answers are missing the point.
This isn't about Bitbucket caching the yarn installation... it's about caching the modules that yarn installs... the dependencies of the project being built.
I routinely see my `yarn install`s taking ~3m... they should take less than a second if my node_modules directory was being cached properly
After playing around a bit, I've found that the following currently works
pipelines: default: - step: name: Build image: node:6.11.4 caches: - yarncustom script: - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2 - export PATH=$HOME/.yarn/bin:$PATH - yarn - yarn build definitions: caches: yarncustom: /usr/local/share/.cache/yarn/v1
I got here by executing "yarn cache dir" on a Bitbucket Pipeline and then just setup a custom cache as per the documentation. I then executed my build subsequent times with "yarn --verbose". I was able to confirm that builds were using the cache by seeing if it needed to download the modules again.
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot