From 060353852216e81a5f815fae4461fd1068d05e20 Mon Sep 17 00:00:00 2001 From: Pam Selle Date: Mon, 30 Jul 2018 11:50:53 -0400 Subject: [PATCH] build: Circle 2.0 migration fixes #20 --- .circleci/config.yml | 59 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 18 -------------- 2 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..f658609 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,59 @@ +defaults: &defaults + docker: + - image: circleci/node:8.10 + working_directory: ~/circleci-deployment + +version: 2 + +jobs: + install: + <<: *defaults + steps: + - checkout + - restore_cache: + key: yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} + - run: yarn + - save_cache: + paths: + - node_modules + key: yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} + + test: + <<: *defaults + steps: + - checkout + - restore_cache: + key: yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} + - run: yarn run validate + - save_cache: + key: v1-dist-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }} + paths: + - dist + + deploy: + <<: *defaults + steps: + - checkout + - restore_cache: + keys: + - yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} + - v1-dist-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }} + - run: cp .npmrc-ci .npmrc + - run: yarn run release + +workflows: + version: 2 + test_build_deploy: + jobs: + - install + - test: + requires: + - install + - deploy: + requires: + - install + - test + filters: + branches: + only: + - master diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 41082c5..0000000 --- a/circle.yml +++ /dev/null @@ -1,18 +0,0 @@ -machine: - node: - version: 8.10.0 -dependencies: - override: - - if [ $CIRCLE_BRANCH = 'master' ]; then cp .npmrc-ci .npmrc; fi - - yarn - cache_directories: - - ~/.cache/yarn -test: - override: - - yarn run validate -deployment: - release: - branch: master - owner: iopipe - commands: - - yarn run release