From eb3cc35ef5cf8cc91b0e63518c6b96c04f4bae3e Mon Sep 17 00:00:00 2001 From: Vincenzo Chianese Date: Wed, 1 Nov 2017 11:46:19 +0100 Subject: [PATCH 1/2] Remove docker scripts from package.json --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index c591b9b12..2950d945a 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,6 @@ "test-all": "cross-env EG_CONFIG_DIR=test/config EG_DISABLE_CONFIG_WATCH=true mocha --recursive test --timeout 60000", "test:unit": "cross-env EG_CONFIG_DIR=test/config EG_DISABLE_CONFIG_WATCH=true mocha --recursive \"./test/{,!(e2e)/**/}*.test.js\" --timeout 5000", "test:e2e": "mocha --recursive test/e2e --timeout 60000", - "docker:create": "docker build -t expressgateway/express-gateway:v$npm_package_version --build-arg VERSION=$npm_package_version - < Dockerfile", - "docker-gs:create": "docker build -t expressgateway/express-gateway:v${npm_package_version}-getting-started --build-arg VERSION=$npm_package_version --build-arg TYPE=getting-started - < Dockerfile", - "docker:publish": "docker push expressgateway/express-gateway:v$npm_package_version", - "docker-gs:publish": "docker push expressgateway/express-gateway:v${npm_package_version}-getting-started", "mocha-istanbul": "nyc --reporter=lcov npm run test-all && nyc report --report=lcov > coverage.lcov && codecov" }, "bin": { From 84671a47c513eb04967dc9564e6514e0a69c2955 Mon Sep 17 00:00:00 2001 From: Vincenzo Chianese Date: Wed, 1 Nov 2017 11:50:37 +0100 Subject: [PATCH 2/2] Publish to npm and docker images on tag creation --- .circleci/config.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3eaffcf1..d096a51e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,9 +20,36 @@ jobs: - run: npm install - run: npm test + deploy: + docker: + - image: circleci/node:8 + working_directory: ~/repo + + steps: + - setup_remote_docker + - run: npm publish + - run: "docker build -t expressgateway/express-gateway:${CIRCLE_TAG} --build-arg VERSION=latest - < Dockerfile" + - run: | + "docker build -t expressgateway/express-gateway:${CIRCLE_TAG}-getting-started + --build-arg VERSION=latest --build-arg TYPE=getting-started - < Dockerfile" + - run: "docker tag expressgateway/express-gateway:${CIRCLE_TAG} expressgateway/express-gateway:latest" + - run: "docker tag expressgateway/express-gateway:${CIRCLE_TAG}-getting-started expressgateway/express-gateway:latest" + - run: "docker push expressgateway/express-gateway:${CIRCLE_TAG}" + - run: "docker push expressgateway/express-gateway:${CIRCLE_TAG}-getting-started" + - run: "docker push expressgateway/express-gateway:latest" + - run: "docker push expressgateway/express-gateway:latest-getting-started" + workflows: version: 2 build: jobs: - node-6 - node-8 + - deploy: + filters: + tags: + only: /^v\d\.\d\.\d/ + branches: + only: master + requires: + - node-8