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 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": {