Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 188 lines (187 sloc) 5.61 KB
version: 2.0
notify:
branches:
only:
- master
- l10n
jobs:
build:
docker:
- image: circleci/node:8.9.4
working_directory: ~/testpilot
steps:
- checkout
- restore_cache:
keys:
- v2-npm-deps-{{ checksum "package.json" }}-{{ checksum "addon/package.json" }}
- v2-npm-deps-{{ checksum "package.json" }}-
- v2-npm-deps-
- run:
name: Setup env
command: |
curl -L --create-dirs -o ~/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && chmod +x ~/bin/jq
./bin/circleci/install-node-dependencies.sh
- run:
name: Build addon and frontend
command: |
./bin/circleci/build-addon.sh
./bin/circleci/build-version-json.sh
./bin/circleci/build-frontend.sh
- store_artifacts:
path: ~/testpilot/addon/update.rdf
- store_artifacts:
path: ~/testpilot/addon/addon.xpi
- store_artifacts:
path: ~/testpilot/frontend.zip
- persist_to_workspace:
root: .
paths:
- ./*
- save_cache:
key: v2-npm-deps-{{ checksum "package.json" }}-{{ checksum "addon/package.json" }}
paths:
- node_modules
- addon/node_modules
unit_test:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run: mkdir junit
- run: ./bin/circleci/test-addon.sh
- run:
command: ./bin/circleci/test-frontend.sh
environment:
MOCHA_FILE: junit/test-results.xml
- store_test_results:
path: junit
- run:
name: Codecov
command: bash <(curl -s https://codecov.io/bash)
integration_test:
docker:
- image: circleci/node:8.9.4
environment:
- MOZ_HEADLESS: 1
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- v2-integration-test-{{ checksum "frontend/test/ui/requirements/requirements.txt" }}-{{ checksum "frontend/test/ui/requirements/flake8.txt" }}
- v2-integration-test-{{ checksum "frontend/test/ui/requirements/requirements.txt" }}-
- v2-integration-test-
- run:
name: Set hosts
command: |
echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
cat /etc/hosts
- run:
name: Install dependencies
command: ./bin/circleci/install-test-dependencies.sh
- run:
name: Build addon
command: ENVIRONMENT_TITLE="local" ENVIRONMENT_URL="https://example.com:8000/" ./bin/circleci/build-addon.sh
- store_artifacts:
path: ~/project/addon/addon.xpi
- run:
name: Flake8
command: ./bin/circleci/flake8.sh
- run: mkdir integration-test-results
- run:
name: Test Firefox Release
command: ./bin/circleci/test-firefox-release.sh
- run:
name: Test Firefox Nightly
command: ./bin/circleci/test-firefox-nightly.sh
- store_artifacts:
path: ~/project/integration-test-results
- save_cache:
key: v2-integration-test-{{ checksum "frontend/test/ui/requirements/requirements.txt" }}-{{ checksum "frontend/test/ui/requirements/flake8.txt" }}
paths:
- .tox
static_deploy:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run:
name: Install AWSCLI
command: |
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install awscli --upgrade
- run:
name: Static deployment
command: |
TESTPILOT_BUCKET=testpilot.dev.mozaws.net ./bin/circleci/do-exclusively.sh --branch master ./bin/deploy.sh dev
./bin/circleci/invalidate-cloudfront-cache.sh E2ERG47PHCWD0Z
storybook_deploy:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run:
name: Install AWSCLI
command: |
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install awscli --upgrade
- run:
name: Storybook Deploy
command: ./bin/deploy-storybook.sh
l10n_deploy:
docker:
- image: circleci/node:8.9.4
steps:
- attach_workspace:
at: .
- run:
name: Install AWSCLI
command: |
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install awscli --upgrade
- run:
name: l10n deployment
command: |
TESTPILOT_BUCKET=testpilot-l10n.dev.mozaws.net ./bin/deploy.sh dev
./bin/circleci/invalidate-cloudfront-cache.sh ELL21V1NJAJJ8
workflows:
version: 2
build_test_deploy:
jobs:
- build
- unit_test:
requires:
- build
- integration_test:
requires:
- build
filters:
branches:
ignore:
- l10n
# - storybook_deploy:
# requires:
# - build
# filters:
# branches:
# ignore:
# - l10n
- static_deploy:
requires:
- unit_test
- integration_test
filters:
branches:
only: master
- l10n_deploy:
requires:
- unit_test
filters:
branches:
only: l10n