UNPKG

2.39 kBYAMLView Raw
1version: 2
2jobs:
3 build:
4 machine: true
5 working_directory: ~/build-tools
6 steps:
7 - checkout
8 - restore_cache:
9 key: dependency-cache-{{ checksum "package.json" }}
10 - run:
11 name: Install node@8.10.0
12 command: |
13 set +e
14 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
15 export NVM_DIR="/opt/circleci/.nvm"
16 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
17 nvm install v8.10.0
18 nvm alias default v8.10.0
19
20 # Each step uses the same `$BASH_ENV`, so need to modify it
21 echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
22 echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
23 - run:
24 name: pre-deps
25 command: |
26 npm install -g yarn@1.5.1
27 sudo chmod -R a+w /usr/local
28 yarn config set cache-folder ~/.cache/yarn
29 if [ "${NPM_TOKEN}" == "" ]; then rm .npmrc; fi
30 ./scripts/install-npm-retry.sh
31 - run:
32 name: install-deps
33 command: |
34 npm run setup
35 if [ "${NPM_TOKEN}" != "" ]; then
36 ./scripts/install-dont-break.sh
37 node_modules/@egis/egis-ui-test-utils/scripts/update-chrome.sh
38 fi
39 - save_cache:
40 key: dependency-cache-{{ checksum "package.json" }}
41 paths:
42 - node_modules
43 - ~/.cache/yarn
44 - yarn.lock
45 - run:
46 name: post-deps
47 command: |
48 mkdir ci-artifacts
49 grep "version\"\:" node_modules/*/*/package.json > ci-artifacts/npm_versions.txt
50 grep "version\"\:" node_modules/*/package.json >> ci-artifacts/npm_versions.txt
51 grep "version\"\:" node_modules/*/*/*/package.json >> ci-artifacts/npm_versions.txt
52 cp yarn.lock ci-artifacts/
53 when: always
54 - store_artifacts:
55 path: ci-artifacts/
56 - run:
57 name: test
58 command: |
59 npm test
60 ./scripts/merge-build-tools-deps.js && git checkout -- package.json
61 if [ "${NPM_TOKEN}" != "" ]; then
62 cp -f .npmrc ~
63 dont-break --timeout 600
64 fi
65 - run:
66 name: deploy
67 command: ./scripts/semantic-release.sh