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
|
2020-11-09 10:42:54 -05:00
|
|
|
- &save_git_cache
|
|
|
|
save_cache:
|
|
|
|
paths:
|
|
|
|
- .git
|
|
|
|
key: v1-git-{{ .Revision }}
|
|
|
|
- &restore_git_cache
|
|
|
|
restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-git-{{ .Revision }}
|
|
|
|
- v1-git-
|
2020-10-30 17:18:40 -04:00
|
|
|
- &save_npm_cache
|
|
|
|
save_cache:
|
|
|
|
paths:
|
|
|
|
- node_modules
|
2020-11-09 11:10:27 -05:00
|
|
|
key: v1-npm-{{ checksum "package-lock.json" }}
|
2020-10-30 17:23:11 -04:00
|
|
|
- &restore_npm_cache
|
2020-10-30 17:18:40 -04:00
|
|
|
restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-npm-{{ checksum "package-lock.json" }}
|
2020-11-09 10:42:54 -05:00
|
|
|
- &save_build_cache
|
2020-11-09 10:57:19 -05:00
|
|
|
save_cache:
|
2020-11-09 10:42:54 -05:00
|
|
|
paths:
|
|
|
|
- ./build
|
|
|
|
- ./intl
|
2020-11-09 11:10:27 -05:00
|
|
|
key: v1-build-{{ .Revision }}
|
2020-11-09 10:42:54 -05:00
|
|
|
- &restore_build_cache
|
|
|
|
restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-build-{{ .Revision }}
|
|
|
|
- v1-build-
|
2021-12-14 15:14:12 -05:00
|
|
|
- &build_no_cache
|
2021-12-10 15:41:18 -05:00
|
|
|
<<: *defaults
|
|
|
|
resource_class: medium+
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: "setup"
|
|
|
|
command: |
|
|
|
|
npm --production=false ci
|
|
|
|
mkdir ./test/results
|
|
|
|
- run:
|
|
|
|
name: "run lint tests"
|
|
|
|
command: |
|
|
|
|
npm run test:lint:ci
|
|
|
|
- run:
|
|
|
|
name: "run npm build"
|
|
|
|
command: |
|
|
|
|
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
|
|
|
|
- run:
|
|
|
|
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
|
|
|
|
- store_test_results:
|
|
|
|
path: test/results
|
2020-11-12 09:57:10 -05:00
|
|
|
- &build
|
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-11-09 10:42:54 -05:00
|
|
|
- *restore_git_cache
|
2020-10-29 15:56:05 -04:00
|
|
|
- checkout
|
2020-11-02 12:03:10 -05:00
|
|
|
- run:
|
2021-02-02 11:41:05 -05:00
|
|
|
name: "setup"
|
2020-11-09 10:42:54 -05:00
|
|
|
command: |
|
2021-02-03 10:36:29 -05:00
|
|
|
npm --production=false ci
|
2021-02-02 11:03:41 -05:00
|
|
|
mkdir ./test/results
|
2021-02-02 11:41:05 -05:00
|
|
|
- run:
|
|
|
|
name: "run lint tests"
|
|
|
|
command: |
|
|
|
|
npm run test:lint:ci
|
2021-02-02 10:36:44 -05:00
|
|
|
- run:
|
|
|
|
name: "run npm build"
|
|
|
|
command: |
|
|
|
|
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
|
|
|
|
- run:
|
|
|
|
name: "Run unit tests"
|
|
|
|
command: |
|
2021-03-02 11:34:27 -05:00
|
|
|
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
|
2021-02-02 10:36:44 -05:00
|
|
|
npm run test:unit:convertReportToXunit
|
2020-11-09 10:42:54 -05:00
|
|
|
- *save_npm_cache
|
|
|
|
- *save_git_cache
|
|
|
|
- *save_build_cache
|
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
|
2020-11-12 09:57:10 -05:00
|
|
|
- &deploy
|
2020-11-09 10:42:54 -05:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- *restore_git_cache
|
|
|
|
- checkout
|
|
|
|
- *restore_npm_cache
|
|
|
|
- *restore_build_cache
|
2021-02-10 10:08:50 -05:00
|
|
|
- run:
|
2021-02-10 10:48:29 -05:00
|
|
|
name: "setup python"
|
2021-02-10 10:08:50 -05:00
|
|
|
command: |
|
2021-03-30 17:59:41 -04:00
|
|
|
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py
|
2021-02-10 10:56:52 -05:00
|
|
|
python3 get-pip.py pip==21.0.1
|
2021-02-10 10:34:25 -05:00
|
|
|
pip install s3cmd==2.1.0
|
2021-02-10 10:48:29 -05:00
|
|
|
- run:
|
2021-05-11 15:08:31 -04:00
|
|
|
name: "deploy"
|
2021-02-10 10:48:29 -05:00
|
|
|
command: |
|
2020-11-09 10:42:54 -05:00
|
|
|
npm run deploy
|
2021-01-11 11:19:18 -05:00
|
|
|
- &integration_jest
|
2020-11-09 10:42:54 -05:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- *restore_git_cache
|
|
|
|
- checkout
|
|
|
|
- *restore_npm_cache
|
2020-11-02 12:03:10 -05:00
|
|
|
- run:
|
2021-01-11 11:19:18 -05:00
|
|
|
name: "integration tests with Jest"
|
2020-11-02 12:03:10 -05:00
|
|
|
command: |
|
2021-11-15 17:10:25 -05:00
|
|
|
JEST_JUNIT_OUTPUT_NAME=integration-jest-results.xml npm run test:integration:remote -- --reporters=jest-junit
|
2021-01-12 12:01:58 -05:00
|
|
|
- store_test_results:
|
|
|
|
path: test/results
|
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
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-staging:
|
|
|
|
<<: *build
|
|
|
|
build-production:
|
2021-02-18 14:36:45 -05:00
|
|
|
<<: *build
|
2020-11-12 09:57:10 -05:00
|
|
|
deploy-staging:
|
2020-12-07 10:23:24 -05:00
|
|
|
<<: *deploy
|
2020-11-12 09:57:10 -05:00
|
|
|
deploy-production:
|
2021-04-05 11:04:41 -04:00
|
|
|
<<: *deploy
|
2021-01-11 11:19:18 -05:00
|
|
|
integration-staging-jest:
|
|
|
|
<<: *integration_jest
|
|
|
|
integration-production-jest:
|
2021-04-05 11:04:41 -04:00
|
|
|
<<: *integration_jest
|
2021-04-23 13:40:47 -04:00
|
|
|
update-translations:
|
|
|
|
<<: *update-translations
|
2021-12-14 15:14:12 -05:00
|
|
|
build-no-cache:
|
|
|
|
<<: *build_no_cache
|
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:
|
2020-11-09 14:50:21 -05:00
|
|
|
- build-staging:
|
2020-11-12 09:57:10 -05:00
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
2020-11-09 10:42:54 -05:00
|
|
|
filters:
|
|
|
|
branches:
|
2021-12-10 15:41:18 -05:00
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|
2021-02-18 14:36:45 -05:00
|
|
|
- build-production:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-production
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2021-03-23 16:01:09 -04:00
|
|
|
- deploy-staging:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
|
|
|
requires:
|
|
|
|
- build-staging
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|
2021-04-05 11:04:41 -04:00
|
|
|
- deploy-production:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-production
|
|
|
|
requires:
|
|
|
|
- build-production
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2021-03-23 16:01:09 -04:00
|
|
|
- integration-staging-jest:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
|
|
|
requires:
|
|
|
|
- deploy-staging
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|
2021-04-05 11:04:41 -04:00
|
|
|
- integration-production-jest:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-production
|
|
|
|
requires:
|
|
|
|
- deploy-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:
|
2021-12-14 15:14:12 -05:00
|
|
|
- build-no-cache:
|
2021-12-10 15:41:18 -05:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- develop
|
|
|
|
- master
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|