2020-10-27 14:10:50 -04:00
|
|
|
version: 2.1
|
2020-10-29 10:52:45 -04:00
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
docker:
|
2021-02-10 10:07:51 -05:00
|
|
|
- image: cimg/node:12.20.1-browsers
|
2020-10-29 10:52:45 -04:00
|
|
|
auth:
|
|
|
|
username: $DOCKERHUB_USERNAME
|
|
|
|
password: $DOCKERHUB_PASSWORD
|
2020-10-30 09:41:30 -04:00
|
|
|
working_directory: ~/repo
|
2022-01-24 16:05:45 -05:00
|
|
|
- &setup
|
|
|
|
name: "setup"
|
|
|
|
command: |
|
|
|
|
npm --production=false ci
|
|
|
|
mkdir ./test/results
|
|
|
|
- &lint
|
|
|
|
name: "run lint tests"
|
|
|
|
command: |
|
|
|
|
npm run test:lint:ci
|
|
|
|
- &build
|
|
|
|
name: "run npm build"
|
|
|
|
command: |
|
|
|
|
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
|
|
|
|
- &unit
|
|
|
|
name: "Run unit tests"
|
|
|
|
command: |
|
|
|
|
JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run test:unit:jest:unit -- --reporters=jest-junit
|
|
|
|
JEST_JUNIT_OUTPUT_NAME=localization-jest-results.xml npm run test:unit:jest:localization -- --reporters=jest-junit
|
|
|
|
npm run test:unit:tap -- --output-file ./test/results/unit-raw.tap
|
|
|
|
npm run test:unit:convertReportToXunit
|
|
|
|
- &setup_python
|
|
|
|
name: "setup python"
|
|
|
|
command: |
|
|
|
|
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py
|
|
|
|
python3 get-pip.py pip==21.0.1
|
|
|
|
pip install s3cmd==2.1.0
|
|
|
|
- &deploy
|
|
|
|
name: "deploy"
|
|
|
|
command: |
|
|
|
|
npm run deploy
|
|
|
|
- &integration
|
|
|
|
name: "integration tests with Jest"
|
|
|
|
command: |
|
|
|
|
JEST_JUNIT_OUTPUT_NAME=integration-jest-results.xml npm run test:integration:remote -- --reporters=jest-junit
|
|
|
|
- &build_no_deploy
|
2021-12-10 15:41:18 -05:00
|
|
|
<<: *defaults
|
2021-12-20 09:34:53 -05:00
|
|
|
resource_class: large
|
2021-12-10 15:41:18 -05:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *setup
|
2021-12-10 15:41:18 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *lint
|
2021-12-10 15:41:18 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *build
|
2021-12-10 15:41:18 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *unit
|
2021-12-10 15:41:18 -05:00
|
|
|
- store_test_results:
|
|
|
|
path: test/results
|
2022-01-24 16:05:45 -05:00
|
|
|
- &build_and_deploy
|
2020-10-29 10:52:45 -04:00
|
|
|
<<: *defaults
|
2021-12-09 15:54:19 -05:00
|
|
|
resource_class: large
|
2020-10-29 10:52:45 -04:00
|
|
|
steps:
|
2020-10-29 15:56:05 -04:00
|
|
|
- checkout
|
2020-11-02 12:03:10 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *setup
|
|
|
|
- run:
|
|
|
|
<<: *lint
|
|
|
|
- run:
|
|
|
|
<<: *build
|
2021-02-02 11:41:05 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *unit
|
2021-02-02 10:36:44 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *setup_python
|
2021-02-02 10:36:44 -05:00
|
|
|
- run:
|
2022-01-24 16:05:45 -05:00
|
|
|
<<: *deploy
|
|
|
|
- run:
|
|
|
|
<<: *integration
|
2021-02-02 10:36:44 -05:00
|
|
|
- store_test_results:
|
|
|
|
path: test/results
|
2021-05-11 15:27:09 -04:00
|
|
|
- run:
|
|
|
|
name: Compress Artifacts
|
|
|
|
command: tar -cvzf build.tar build
|
2021-02-23 09:41:09 -05:00
|
|
|
- store_artifacts:
|
2021-05-11 15:27:09 -04:00
|
|
|
path: build.tar
|
2021-04-23 13:40:47 -04:00
|
|
|
- &update-translations
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
2021-05-04 11:20:47 -04:00
|
|
|
- run:
|
|
|
|
name: "setup"
|
|
|
|
command: npm --production=false ci
|
2021-04-23 13:40:47 -04:00
|
|
|
- run:
|
|
|
|
name: "run i18n script"
|
|
|
|
command: npm run i18n:push
|
2020-11-12 09:57:10 -05:00
|
|
|
|
2022-02-01 14:59:24 -05:00
|
|
|
# build-test-deploy requires two separately named jobs
|
2020-11-12 09:57:10 -05:00
|
|
|
jobs:
|
2022-01-24 16:05:45 -05:00
|
|
|
build-and-deploy-staging:
|
|
|
|
<<: *build_and_deploy
|
|
|
|
build-and-deploy-production:
|
|
|
|
<<: *build_and_deploy
|
2021-04-23 13:40:47 -04:00
|
|
|
update-translations:
|
|
|
|
<<: *update-translations
|
2022-01-24 16:05:45 -05:00
|
|
|
build-no-deploy:
|
|
|
|
<<: *build_no_deploy
|
2020-10-29 10:52:45 -04:00
|
|
|
|
2020-10-27 14:10:50 -04:00
|
|
|
workflows:
|
2021-03-23 16:01:09 -04:00
|
|
|
build-test-deploy:
|
2020-10-27 14:10:50 -04:00
|
|
|
jobs:
|
2022-01-24 16:05:45 -05:00
|
|
|
- build-and-deploy-staging:
|
2021-03-23 16:01:09 -04:00
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|
2022-01-24 16:05:45 -05:00
|
|
|
- build-and-deploy-production:
|
2021-04-05 11:04:41 -04:00
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-production
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2021-04-23 13:40:47 -04:00
|
|
|
Update-translations:
|
|
|
|
triggers:
|
|
|
|
- schedule: # every evening at 7pm EST (8pm EDT, Midnight UTC)
|
|
|
|
cron: "0 0 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: develop
|
|
|
|
jobs:
|
|
|
|
- update-translations:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
2021-12-14 15:14:12 -05:00
|
|
|
build-test-no-deploy:
|
2021-12-10 15:41:18 -05:00
|
|
|
jobs:
|
2022-01-24 16:05:45 -05:00
|
|
|
- build-no-deploy:
|
2021-12-10 15:41:18 -05:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- develop
|
|
|
|
- master
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|