2018-02-26 00:44:46 +01:00
|
|
|
version: 2.0
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2018-08-02 21:24:36 +02:00
|
|
|
- image: circleci/node:10
|
2018-02-26 00:44:46 +01:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2018-10-04 02:39:39 +02:00
|
|
|
key: send-build-{{ checksum "package-lock.json" }}
|
2018-02-26 00:44:46 +01:00
|
|
|
- run: npm install
|
|
|
|
- save_cache:
|
2018-10-04 02:39:39 +02:00
|
|
|
key: send-build-{{ checksum "package-lock.json" }}
|
2018-02-26 00:44:46 +01:00
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
- run: npm run build
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
2018-10-04 02:39:39 +02:00
|
|
|
- ./dist
|
2018-02-26 00:44:46 +01:00
|
|
|
test:
|
|
|
|
docker:
|
2018-08-02 21:24:36 +02:00
|
|
|
- image: circleci/node:10-browsers
|
2018-02-26 00:44:46 +01:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2018-10-04 02:39:39 +02:00
|
|
|
key: send-test-{{ checksum "package-lock.json" }}
|
2018-02-26 00:44:46 +01:00
|
|
|
- run: npm install
|
|
|
|
- save_cache:
|
2018-10-04 02:39:39 +02:00
|
|
|
key: send-test-{{ checksum "package-lock.json" }}
|
2018-02-26 00:44:46 +01:00
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
- run: npm run lint
|
2018-04-24 17:00:19 +02:00
|
|
|
- run: npm run test
|
2018-02-26 19:09:28 +01:00
|
|
|
- store_artifacts:
|
|
|
|
path: coverage
|
2018-04-24 17:00:19 +02:00
|
|
|
integration_tests:
|
2018-10-04 02:39:39 +02:00
|
|
|
docker:
|
2019-03-13 01:47:54 +01:00
|
|
|
- image: circleci/node:10-browsers
|
2018-04-24 17:00:19 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-10-04 02:39:39 +02:00
|
|
|
- restore_cache:
|
|
|
|
key: send-int-{{ checksum "package-lock.json" }}
|
|
|
|
- run: npm install
|
|
|
|
- save_cache:
|
|
|
|
key: send-int-{{ checksum "package-lock.json" }}
|
|
|
|
paths:
|
|
|
|
- node_modules
|
2019-03-13 01:47:54 +01:00
|
|
|
- run:
|
|
|
|
name: Run integration test
|
|
|
|
command: ./scripts/bin/run-integration-test-circleci.sh
|
2018-02-26 00:44:46 +01:00
|
|
|
deploy_dev:
|
|
|
|
machine: true
|
|
|
|
steps:
|
2018-05-04 00:00:34 +02:00
|
|
|
- checkout
|
2018-02-26 00:44:46 +01:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-02-26 02:06:28 +01:00
|
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-02-26 00:44:46 +01:00
|
|
|
- run: docker build -t mozilla/send:latest .
|
|
|
|
- run: docker push mozilla/send:latest
|
2018-09-18 20:23:04 +02:00
|
|
|
deploy_vnext:
|
|
|
|
machine: true
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
|
|
- run: docker build -t mozilla/send:vnext .
|
|
|
|
- run: docker push mozilla/send:vnext
|
2018-02-26 00:44:46 +01:00
|
|
|
deploy_stage:
|
|
|
|
machine: true
|
|
|
|
steps:
|
2018-05-04 00:00:34 +02:00
|
|
|
- checkout
|
2018-02-26 00:44:46 +01:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-02-26 02:06:28 +01:00
|
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-02-26 00:44:46 +01:00
|
|
|
- run: docker build -t mozilla/send:$CIRCLE_TAG .
|
|
|
|
- run: docker push mozilla/send:$CIRCLE_TAG
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
test_pr:
|
|
|
|
jobs:
|
2018-05-04 00:00:34 +02:00
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
branches:
|
2018-09-18 20:23:04 +02:00
|
|
|
ignore:
|
|
|
|
- master
|
|
|
|
- vnext
|
2018-02-26 00:44:46 +01:00
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
branches:
|
2018-09-18 20:23:04 +02:00
|
|
|
ignore:
|
|
|
|
- master
|
|
|
|
- vnext
|
2018-10-04 02:39:39 +02:00
|
|
|
- integration_tests:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
2018-02-26 00:44:46 +01:00
|
|
|
build_and_deploy_dev:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
branches:
|
2018-09-18 20:23:04 +02:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- vnext
|
2018-02-26 00:44:46 +01:00
|
|
|
tags:
|
|
|
|
ignore: /^v.*/
|
2018-02-26 02:06:28 +01:00
|
|
|
- deploy_dev:
|
2018-02-26 00:44:46 +01:00
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
tags:
|
|
|
|
ignore: /^v.*/
|
2018-09-18 20:23:04 +02:00
|
|
|
- deploy_vnext:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: vnext
|
|
|
|
tags:
|
|
|
|
ignore: /^v.*/
|
2018-02-26 00:44:46 +01:00
|
|
|
build_and_deploy_stage:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
2018-02-26 02:14:37 +01:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-02-26 00:44:46 +01:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
|
|
|
- test:
|
|
|
|
filters:
|
2018-02-26 02:14:37 +01:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-02-26 00:44:46 +01:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-05-04 08:47:44 +02:00
|
|
|
- integration_tests:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-02-26 00:44:46 +01:00
|
|
|
- deploy_stage:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
- test
|
2018-05-04 08:47:44 +02:00
|
|
|
- integration_tests
|
2018-02-26 00:44:46 +01:00
|
|
|
filters:
|
2018-02-26 02:14:37 +01:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-02-26 00:44:46 +01:00
|
|
|
tags:
|
2018-04-24 17:00:19 +02:00
|
|
|
only: /^v.*/
|