2020-10-27 14:10:50 -04:00
|
|
|
version: 2.1
|
2020-10-29 10:52:45 -04:00
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:12-browsers
|
|
|
|
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" }}
|
|
|
|
- v1-npm-
|
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-
|
2020-11-12 09:57:10 -05:00
|
|
|
- &build
|
2020-10-29 10:52:45 -04:00
|
|
|
<<: *defaults
|
|
|
|
steps:
|
2020-11-09 10:42:54 -05:00
|
|
|
- *restore_git_cache
|
2020-10-29 15:56:05 -04:00
|
|
|
- checkout
|
2020-11-09 10:42:54 -05:00
|
|
|
- *restore_npm_cache
|
2020-11-02 12:03:10 -05:00
|
|
|
- run:
|
2020-11-09 10:42:54 -05:00
|
|
|
name: "Run npm test to build"
|
|
|
|
command: |
|
|
|
|
npm --production=false ci
|
2020-11-09 15:02:55 -05:00
|
|
|
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run test
|
2020-11-09 10:42:54 -05:00
|
|
|
- *save_npm_cache
|
|
|
|
- *save_git_cache
|
|
|
|
- *save_build_cache
|
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
|
|
|
|
- run:
|
|
|
|
name: "deploy to staging"
|
2020-11-02 12:03:10 -05:00
|
|
|
command: |
|
2020-11-09 10:42:54 -05:00
|
|
|
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
|
|
|
python get-pip.py
|
|
|
|
pip install -r requirements.txt
|
|
|
|
npm run deploy
|
2020-11-12 09:57:10 -05:00
|
|
|
- &integration
|
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:
|
2020-11-09 10:42:54 -05:00
|
|
|
name: "integration tests"
|
2020-11-02 12:03:10 -05:00
|
|
|
command: |
|
2020-11-09 10:42:54 -05:00
|
|
|
npm run test:integration:remote
|
2020-11-12 09:57:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-staging:
|
|
|
|
<<: *build
|
|
|
|
build-production:
|
|
|
|
# <<: *build
|
|
|
|
deploy-staging:
|
|
|
|
<<: *deploy
|
|
|
|
deploy-production:
|
|
|
|
# <<: *deploy
|
|
|
|
integration-staging:
|
|
|
|
<<: *integration
|
2020-11-09 10:42:54 -05:00
|
|
|
integration-production:
|
2020-11-12 09:57:10 -05:00
|
|
|
# <<: *integration
|
2020-10-29 10:52:45 -04:00
|
|
|
|
2020-10-27 14:10:50 -04:00
|
|
|
workflows:
|
2020-10-29 10:52:45 -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:
|
|
|
|
only:
|
|
|
|
- circleci-project-setup # remove this before releasing
|
2020-11-09 14:50:21 -05:00
|
|
|
- develop
|
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|
2020-11-09 10:42:54 -05:00
|
|
|
- deploy-staging:
|
2020-11-12 09:57:10 -05:00
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
2020-11-09 10:42:54 -05:00
|
|
|
requires:
|
2020-11-09 14:50:21 -05:00
|
|
|
- build-staging
|
2020-11-09 10:42:54 -05:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- circleci-project-setup # remove this before releasing
|
|
|
|
- develop
|
2020-11-09 14:50:21 -05:00
|
|
|
- /^hotfix\/.*/ # make sure this syntax works. may need a regex
|
|
|
|
- /^release\/.*/
|
2020-11-09 10:42:54 -05:00
|
|
|
- integration-staging:
|
2020-11-12 09:57:10 -05:00
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
2020-11-09 10:42:54 -05:00
|
|
|
requires:
|
|
|
|
- deploy-staging
|
2020-10-27 15:05:42 -04:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- circleci-project-setup # remove this before releasing
|
2020-11-09 10:42:54 -05:00
|
|
|
- develop
|
2020-11-09 14:50:21 -05:00
|
|
|
- /^hotfix\/.*/
|
|
|
|
- /^release\/.*/
|
2020-11-16 11:28:31 -05:00
|
|
|
test-build-cron:
|
|
|
|
triggers:
|
|
|
|
- schedule: # every 15 minutes
|
2020-11-16 11:30:05 -05:00
|
|
|
cron: "0,15,30,45 * * * *"
|
2020-11-16 11:28:31 -05:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: circleci-project-setup
|
|
|
|
jobs:
|
|
|
|
- build-staging:
|
|
|
|
context:
|
|
|
|
- scratch-www-all
|
|
|
|
- scratch-www-staging
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- circleci-project-setup # remove this before releasing
|