2018-02-25 23:44:46 +00:00
|
|
|
version: 2.0
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2018-12-14 21:18:43 +00:00
|
|
|
- image: circleci/node:10
|
2018-02-25 23:44:46 +00:00
|
|
|
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:
|
2018-05-03 22:00:34 +00:00
|
|
|
- ./dist
|
2018-02-25 23:44:46 +00:00
|
|
|
test:
|
|
|
|
docker:
|
2018-12-14 21:18:43 +00:00
|
|
|
- image: circleci/node:10-browsers
|
2018-02-25 23:44:46 +00:00
|
|
|
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
|
2018-04-24 15:00:19 +00:00
|
|
|
- run: npm run test
|
2018-02-26 18:09:28 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: coverage
|
2018-04-24 15:00:19 +00:00
|
|
|
integration_tests:
|
|
|
|
machine: true
|
|
|
|
steps:
|
|
|
|
- checkout
|
2018-05-03 22:00:34 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-04-24 15:00:19 +00:00
|
|
|
- run:
|
|
|
|
name: Install Docker Compose
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
pip install docker-compose>=1.18
|
|
|
|
docker-compose --version
|
|
|
|
- run:
|
2018-05-03 22:00:34 +00:00
|
|
|
command: npm run test-integration
|
2018-05-04 06:47:44 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: coverage/send-test.html
|
2018-02-25 23:44:46 +00:00
|
|
|
deploy_dev:
|
|
|
|
machine: true
|
|
|
|
steps:
|
2018-05-03 22:00:34 +00:00
|
|
|
- checkout
|
2018-02-25 23:44:46 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-02-26 01:06:28 +00:00
|
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-02-25 23:44:46 +00:00
|
|
|
- run: docker build -t mozilla/send:latest .
|
|
|
|
- run: docker push mozilla/send:latest
|
|
|
|
deploy_stage:
|
|
|
|
machine: true
|
|
|
|
steps:
|
2018-05-03 22:00:34 +00:00
|
|
|
- checkout
|
2018-02-25 23:44:46 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-02-26 01:06:28 +00:00
|
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-02-25 23:44:46 +00:00
|
|
|
- run: docker build -t mozilla/send:$CIRCLE_TAG .
|
|
|
|
- run: docker push mozilla/send:$CIRCLE_TAG
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
test_pr:
|
|
|
|
jobs:
|
2018-05-03 22:00:34 +00:00
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
2018-02-25 23:44:46 +00:00
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
2018-05-03 22:00:34 +00:00
|
|
|
- integration_tests:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
|
|
|
requires:
|
|
|
|
- build
|
2018-02-25 23:44:46 +00:00
|
|
|
build_and_deploy_dev:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
tags:
|
|
|
|
ignore: /^v.*/
|
2018-02-26 01:06:28 +00:00
|
|
|
- deploy_dev:
|
2018-02-25 23:44:46 +00:00
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
tags:
|
|
|
|
ignore: /^v.*/
|
|
|
|
build_and_deploy_stage:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
2018-02-26 01:14:37 +00:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-02-25 23:44:46 +00:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2019-03-09 18:31:32 +00:00
|
|
|
# - test:
|
|
|
|
# filters:
|
|
|
|
# branches:
|
|
|
|
# ignore: /.*/
|
|
|
|
# tags:
|
|
|
|
# only: /^v.*/
|
|
|
|
# - integration_tests:
|
|
|
|
# requires:
|
|
|
|
# - build
|
|
|
|
# filters:
|
|
|
|
# branches:
|
|
|
|
# ignore: /.*/
|
|
|
|
# tags:
|
|
|
|
# only: /^v.*/
|
2018-02-25 23:44:46 +00:00
|
|
|
- deploy_stage:
|
|
|
|
requires:
|
|
|
|
- build
|
2019-03-09 18:31:32 +00:00
|
|
|
# - test
|
|
|
|
# - integration_tests
|
2018-02-25 23:44:46 +00:00
|
|
|
filters:
|
2018-02-26 01:14:37 +00:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-02-25 23:44:46 +00:00
|
|
|
tags:
|
2018-04-24 15:00:19 +00:00
|
|
|
only: /^v.*/
|