Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
circleci v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Feb 26, 2018
1 parent 74b9e36 commit ec2dc92
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 28 deletions.
107 changes: 79 additions & 28 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,79 @@
machine:
node:
version: 8
services:
- docker
- redis

deployment:
latest:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker build -t mozilla/send:latest .
- docker push mozilla/send:latest
tags:
tag: /.*/
owner: mozilla
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker build -t mozilla/send:$CIRCLE_TAG .
- docker push mozilla/send:$CIRCLE_TAG

test:
override:
- npm run build
- npm run lint
- npm test
- nsp check
version: 2.0
jobs:
build:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
key: send-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
key: send-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: npm run build
- persist_to_workspace:
root: .
paths:
- ./*
test:
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
key: send-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
key: send-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: npm run check
- run: npm run lint
- run: npm test
deploy_dev:
machine: true
steps:
- attach_workspace:
at: .
- run: docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- run: docker build -t mozilla/send:latest .
- run: docker push mozilla/send:latest
deploy_stage:
machine: true
steps:
- attach_workspace:
at: .
- run: docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- run: docker build -t mozilla/send:$CIRCLE_TAG .
- run: docker push mozilla/send:$CIRCLE_TAG
workflows:
version: 2
build_and_deploy_dev:
jobs:
- build:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
- deploy_latest:
requires:
- build
filters:
branches:
only: master
tags:
ignore: /^v.*/
- deploy_stage:
requires:
- build
- test
filters:
branches:
only: master
tags:
only: /^v.*/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"precommit": "lint-staged",
"prepush": "npm test",
"check": "nsp check",
"clean": "rimraf dist",
"build": "npm run clean && webpack -p",
"lint": "npm-run-all lint:*",
Expand Down

0 comments on commit ec2dc92

Please # to comment.