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.
@Jake Ben Thanks that worked for me too and double checked like you did. The cache download time is almost as slow as pulling from yarn but still a little boost.
Another point, the node docker image contains yarn so don't think there's a reason to install it via curl.. unless I'm missing something.
Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...
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
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs