From 63b999abae77c6b4a2129a24253f5ce025130087 Mon Sep 17 00:00:00 2001 From: jhiner Date: Fri, 4 May 2018 11:19:11 -0400 Subject: [PATCH 1/3] Update tests --- test/db/grants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/db/grants.js b/test/db/grants.js index c6e1827..d20fc3d 100644 --- a/test/db/grants.js +++ b/test/db/grants.js @@ -13,7 +13,7 @@ const testData = require('../_testData'); // }); test('Create and read grant', t => { - t.true(1===1); + t.true(2===2); // grants.upsert(testData.client, testData.user, 'userinfo', function(err, grant) { // t.true(grant.client_id === testData.client.client_id, 'Client id matches'); From 44b4624c81541a670e3364f91d11e327a12c0aee Mon Sep 17 00:00:00 2001 From: jhiner Date: Fri, 4 May 2018 11:28:40 -0400 Subject: [PATCH 2/3] update circleci --- .circleci/{config.yaml => config.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .circleci/{config.yaml => config.yml} (100%) diff --git a/.circleci/config.yaml b/.circleci/config.yml similarity index 100% rename from .circleci/config.yaml rename to .circleci/config.yml From 53a476a26d986b255eda8c3b6d222291f20f39b0 Mon Sep 17 00:00:00 2001 From: jhiner Date: Mon, 7 May 2018 23:13:25 -0400 Subject: [PATCH 3/3] Add deployment job --- .circleci/config.yml | 111 +++++++++++++++++++++++++++++++++---------- 1 file changed, 86 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f0b674a..809827b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,27 +1,88 @@ -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# -version: 2 -jobs: - build: +defaults: &defaults docker: - # specify the version you desire here - - image: circleci/node:8.11.1 - - working_directory: ~/repo - - steps: - - checkout - - - run: - name: "Checking Versions" - command: | - node --version - npm --version - - - run: npm install - - # run tests! - - run: npm test + - image: circleci/node:8.11.1 + working_directory: ~/tmp/circlci-now +version: 2 +jobs: + checkout: + <<: *defaults + steps: + - checkout + - attach_workspace: + at: ~/tmp/circlci-now + - restore_cache: + keys: + - npm-cache-{{ .Branch }}-{{ checksum "package.json" }} + - npm-cache-{{ .Branch }} + - npm-cache- + - run: + name: "Checking Versions" + command: | + node --version + npm --version + - run: + name: NPM Install + command: npm install + - save_cache: + key: npm-cache-{{ .Branch }}-{{ checksum "package.json" }} + paths: + - node_modules + - persist_to_workspace: + root: . + paths: . + unit-test: + <<: *defaults + steps: + - attach_workspace: + at: ~/tmp/circlci-now + - run: + name: NPM Install + command: npm install + - run: + name: Unit Test + command: npm run test + deploy: + <<: *defaults + steps: + - attach_workspace: + at: ~/tmp/circlci-now + - run: + name: Install Now CLI + command: sudo npm install --global --unsafe-perm now + - deploy: + name: Deploy & Alias + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + now --token $ZEIT_TOKEN --local-config .now/now.production.json + now --token $ZEIT_TOKEN --local-config .now/now.production.json alias + elif [ "${CIRCLE_BRANCH}" == "develop" ]; then + now --token $ZEIT_TOKEN --local-config .now/now.staging.json + now --token $ZEIT_TOKEN --local-config .now/now.staging.json alias + else + ./.now/now.feature.sh + now --token $ZEIT_TOKEN --local-config .now/now.feature.json + now --token $ZEIT_TOKEN --local-config .now/now.feature.json alias + fi +workflows: + version: 2 + build: + jobs: + - checkout + - unit-test: + requires: + - checkout + deploy: + jobs: + - unit-test: + filters: + branches: + only: master + requires: + - checkout + - deploy: + filters: + branches: + only: master + requires: + - unit-test