1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-10 05:02:45 +01:00
send/circle.yml
2018-10-03 11:22:30 -07:00

168 lines
3.9 KiB
YAML

version: 2.0
jobs:
build:
docker:
- image: circleci/node:10
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:10-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 lint
- run: npm run test
- store_artifacts:
path: coverage
integration_tests:
machine: true
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Install Docker Compose
command: |
set -x
pip install docker-compose>=1.18
docker-compose --version
- run:
name: Setup
command: |
set -x
docker-compose pull
- run:
name: Run Integration tests
command: |
set -x
docker-compose up -d selenium-firefox
sleep 10
docker-compose ps
docker-compose exec selenium-firefox npm run test-circle:selenium
deploy_dev:
machine: true
steps:
- checkout
- attach_workspace:
at: .
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker build -t mozilla/send:latest .
- run: docker push mozilla/send:latest
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
deploy_stage:
machine: true
steps:
- checkout
- attach_workspace:
at: .
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker build -t mozilla/send:$CIRCLE_TAG .
- run: docker push mozilla/send:$CIRCLE_TAG
workflows:
version: 2
test_pr:
jobs:
- build:
filters:
branches:
ignore:
- master
- vnext
- test:
filters:
branches:
ignore:
- master
- vnext
# - integration_tests:
# filters:
# branches:
# ignore: master
# requires:
# - build
build_and_deploy_dev:
jobs:
- build:
filters:
branches:
only:
- master
- vnext
tags:
ignore: /^v.*/
- deploy_dev:
requires:
- build
filters:
branches:
only: master
tags:
ignore: /^v.*/
- deploy_vnext:
requires:
- build
filters:
branches:
only: vnext
tags:
ignore: /^v.*/
build_and_deploy_stage:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- test:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- integration_tests:
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- deploy_stage:
requires:
- build
- test
- integration_tests
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/