Skip to content

Instantly share code, notes, and snippets.

@naganowl
Created June 28, 2017 21:35
Show Gist options
  • Save naganowl/02c0043f6bbf3bbb865543fa603e7dfb to your computer and use it in GitHub Desktop.
Save naganowl/02c0043f6bbf3bbb865543fa603e7dfb to your computer and use it in GitHub Desktop.
Updating `yarn` in CircleCI
general:
artifacts:
- "log"
- "npm-debug.log"
- "yarn-error.log"
machine:
node:
version: 6.10.1
dependencies:
pre:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- mkdir -p ~/.cache/yarn
# This seems to have problems with CircleCI cache and only takes ~15 seconds so we could always download.
- if [[ ! -e /usr/share/yarn/bin/yarn ]]; then curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && sudo apt-get update && sudo apt-get install yarn=0.24.6-1; fi
cache_directories:
- /usr/share/yarn/bin
# This is to be specific to the installed `yarn` modules repo. We can leave out `v1` to be more futureproof.
- ~/.cache/yarn/v1
override:
# We need to update `$PATH` anywhere else this would be used since Circle has problems setting it globally.
- /usr/share/yarn/bin/yarn install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment