From 430670aa2c1f3ab1fec266bc3a16c4d467f6745a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matten=20M=C3=A4tlik?= Date: Fri, 17 Aug 2018 10:50:43 +0300 Subject: [PATCH] Merge pull request #71 from Testlio/feature/circle-upgrade/IN-666 Circle 2.0 setup Modify workflow steps for better UX --- .circleci/config.yml | 85 ++++++++++++++++++++++++++++++++++++++++++++ .nvmrc | 2 +- circle.yml | 13 ------- package.json | 2 +- 4 files changed, 87 insertions(+), 15 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..68a221d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,85 @@ +version: 2 +workflows: + version: 2 + install-test-publish: + jobs: + - install-dependencies + - test: + requires: + - install-dependencies + - lint: + requires: + - install-dependencies + - approve-publish-npm: + type: approval + filters: + branches: + only: master + requires: + - test + - lint + - publish-npm: + requires: + - approve-publish-npm + +defaults: + docker: &default + working_directory: ~/builds + docker: + - image: circleci/node:6 + +jobs: + install-dependencies: + <<: *default + steps: + - checkout + - restore_cache: + keys: + - dependencies-cache-{{ checksum "package.json" }} + - dependencies-cache- + - run: + name: Install dependencies + command: npm install --no-save + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - node_modules + - persist_to_workspace: + root: ~/builds + paths: . + + test: + <<: *default + steps: + - checkout + - attach_workspace: + at: ~/builds + - run: + name: Run tests + command: + npm test + + lint: + <<: *default + steps: + - checkout + - attach_workspace: + at: ~/builds + - run: + name: Run linter + command: + npm run lint + + publish-npm: + <<: *default + steps: + - checkout + - attach_workspace: + at: ~/builds + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/builds/.npmrc + - run: + name: Publish package + command: + npm publish diff --git a/.nvmrc b/.nvmrc index 833e0a4..5a33ecb 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v5.7.0 +6.10 diff --git a/circle.yml b/circle.yml deleted file mode 100644 index d654bed..0000000 --- a/circle.yml +++ /dev/null @@ -1,13 +0,0 @@ -machine: - node: - version: 5.7.0 - -test: - pre: - - npm run lint - -deployment: - prod: - tag: /v[0-9]+(\.[0-9]+)*/ - commands: - - npm publish diff --git a/package.json b/package.json index 3c67ae6..38d5d00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambda-tools", - "version": "3.3.1", + "version": "3.3.2", "description": "Scripts for working with AWS Lambda backed microservices", "main": "", "scripts": {