Skip to content

Commit

Permalink
CircleCI 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts committed Feb 27, 2017
1 parent 8ce0199 commit 1c2c46a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 41 deletions.
47 changes: 47 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,47 @@
version: 2
jobs:
build:
environment:
PATH: /root/.yarn/bin:/usr/local/bin:/usr/bin:/bin
YARN_VERSION: 0.20.3
docker:
- image: node:6.10.0
working_directory: ~/baberutv
steps:
- checkout
- restore_cache:
key: baberutv-yarn-v{{ .Environment.CIRCLE_BUILD_NUM }}
- run:
name: Install Yarn
command: |
if [[ ! -n $(which yarn) || $(yarn --version) != "${YARN_VERSION}" ]]; then
echo "Download and install Yarn."
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}
else
echo "The correct version of Yarn is already installed."
fi
- save_cache:
key: baberutv-yarn-v{{ .Environment.CIRCLE_BUILD_NUM }}
paths:
- ~/.yarn
- restore_cache:
key: baberutv-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn
- save_cache:
key: baberutv-dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- ./node_modules
- run:
name: Run Tests
command: yarn test
- run:
name: Post-Test
command: cat ./coverage/lcov.info | $(yarn bin)/coveralls || echo "1"
- deploy:
command: |
if echo ${CIRCLE_TAG} | grep -Eq "^v\\d(\\.\\d+)*$"; then
./scripts/deploy.sh
fi
40 changes: 0 additions & 40 deletions circle.yml

This file was deleted.

7 changes: 6 additions & 1 deletion scripts/deploy.sh
Expand Up @@ -8,7 +8,12 @@ cd $(dirname $0)/..
rm -rf build
yarn build -- --env production
cd build/public
cp ../../circle.yml .
cat <<EOF tee circle.yml
general:
branches:
ignore:
- gh-pages
EOF
cat <<__EOS | node | tee CNAME
const { parse: parseURL } = require('url');
const { homepage: uri } = require('../../package.json');
Expand Down

0 comments on commit 1c2c46a

Please sign in to comment.