@samitouri / QOS-React / commits / 2be0d93c77

Tweak Yarn installation to not run if it's already installed (#8496)

https://circleci.com/docs/install-and-use-yarn/

Tom Occhino committed Dec 4, 2016 at 11:00 UTC 2be0d93c7782eb2dad62efcac9668152da715c25
1 file changed +8 -5
circle.yml
+8 -5
@@ -12,17 +12,19 @@ machine:
12 version: 2.2.3
13 environment:
14 TRAVIS_REPO_SLUG: facebook/react
15 + YARN_VERSION: 0.17.8
16 + PATH: "${PATH}:${HOME}/.yarn/bin"
17
18 dependencies:
19 pre:
20 # This is equivalent to $TRAVIS_COMMIT_RANGE
21 # Need to figure out how to bail early if this is a "docs only" build
22 - echo $CIRCLE_COMPARE_URL | cut -d/ -f7
21 - # install yarn
22 - - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
23 - - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
24 - - sudo apt-get update -qq
25 - - sudo apt-get install -y -qq yarn
23 + # install yarn if it's not already installed
24 + - |
25 + if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
26 + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
27 + fi
28 override:
29 - bundle install --gemfile=docs/Gemfile --deployment --path=vendor/bundle --jobs=3 --retry=3
30 - yarn install
@@ -33,6 +35,7 @@ dependencies:
35 - docs/vendor/bundle
36 - .grunt # Show size comparisons between builds
37 - ~/react-gh-pages # docs checkout
38 + - ~/.yarn
39 - ~/.yarn-cache
40
41 test: