Skip to content

Commit

Permalink
Merge pull request ExpressGateway#496 from ExpressGateway/feature/aut…
Browse files Browse the repository at this point in the history
…odeploy

Automate docker and npm publish part
  • Loading branch information
XVincentX authored Nov 1, 2017
2 parents 03994fc + 30444bd commit c120578
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit c120578

Please sign in to comment.