mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 08:31:23 -05:00
Merge pull request #4642 from LLK/circleci-project-setup
Circleci project setup
This commit is contained in:
commit
91f5e4bba5
2 changed files with 133 additions and 1 deletions
133
.circleci/config.yml
Normal file
133
.circleci/config.yml
Normal file
|
@ -0,0 +1,133 @@
|
|||
version: 2.1
|
||||
|
||||
aliases:
|
||||
- &defaults
|
||||
docker:
|
||||
- image: circleci/node:12-browsers
|
||||
auth:
|
||||
username: $DOCKERHUB_USERNAME
|
||||
password: $DOCKERHUB_PASSWORD
|
||||
working_directory: ~/repo
|
||||
- &save_git_cache
|
||||
save_cache:
|
||||
paths:
|
||||
- .git
|
||||
key: v1-git-{{ .Revision }}
|
||||
- &restore_git_cache
|
||||
restore_cache:
|
||||
keys:
|
||||
- v1-git-{{ .Revision }}
|
||||
- v1-git-
|
||||
- &save_npm_cache
|
||||
save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
key: v1-npm-{{ checksum "package-lock.json" }}
|
||||
- &restore_npm_cache
|
||||
restore_cache:
|
||||
keys:
|
||||
- v1-npm-{{ checksum "package-lock.json" }}
|
||||
- v1-npm-
|
||||
- &save_build_cache
|
||||
save_cache:
|
||||
paths:
|
||||
- ./build
|
||||
- ./intl
|
||||
key: v1-build-{{ .Revision }}
|
||||
- &restore_build_cache
|
||||
restore_cache:
|
||||
keys:
|
||||
- v1-build-{{ .Revision }}
|
||||
- v1-build-
|
||||
- &build
|
||||
<<: *defaults
|
||||
resource_class: medium+
|
||||
steps:
|
||||
- *restore_git_cache
|
||||
- checkout
|
||||
- *restore_npm_cache
|
||||
- run:
|
||||
name: "Run npm test to build"
|
||||
command: |
|
||||
npm --production=false install
|
||||
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run test
|
||||
- *save_npm_cache
|
||||
- *save_git_cache
|
||||
- *save_build_cache
|
||||
- &deploy
|
||||
<<: *defaults
|
||||
steps:
|
||||
- *restore_git_cache
|
||||
- checkout
|
||||
- *restore_npm_cache
|
||||
- *restore_build_cache
|
||||
- run:
|
||||
name: "deploy to staging"
|
||||
command: |
|
||||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
python get-pip.py
|
||||
pip install -r requirements.txt
|
||||
npm run deploy
|
||||
- &integration
|
||||
<<: *defaults
|
||||
steps:
|
||||
- *restore_git_cache
|
||||
- checkout
|
||||
- *restore_npm_cache
|
||||
- run:
|
||||
name: "integration tests"
|
||||
command: |
|
||||
npm run test:integration:remote
|
||||
|
||||
|
||||
jobs:
|
||||
build-staging:
|
||||
<<: *build
|
||||
build-production:
|
||||
# <<: *build
|
||||
deploy-staging:
|
||||
<<: *deploy
|
||||
deploy-production:
|
||||
# <<: *deploy
|
||||
integration-staging:
|
||||
<<: *integration
|
||||
integration-production:
|
||||
# <<: *integration
|
||||
|
||||
workflows:
|
||||
build-test-deploy:
|
||||
jobs:
|
||||
- build-staging:
|
||||
context:
|
||||
- scratch-www-all
|
||||
- scratch-www-staging
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
- /^hotfix\/.*/
|
||||
- /^release\/.*/
|
||||
# - deploy-staging:
|
||||
# context:
|
||||
# - scratch-www-all
|
||||
# - scratch-www-staging
|
||||
# requires:
|
||||
# - build-staging
|
||||
# filters:
|
||||
# branches:
|
||||
# only:
|
||||
# - develop
|
||||
# - /^hotfix\/.*/
|
||||
# - /^release\/.*/
|
||||
# - integration-staging:
|
||||
# context:
|
||||
# - scratch-www-all
|
||||
# - scratch-www-staging
|
||||
# requires:
|
||||
# - deploy-staging
|
||||
# filters:
|
||||
# branches:
|
||||
# only:
|
||||
# - develop
|
||||
# - /^hotfix\/.*/
|
||||
# - /^release\/.*/
|
|
@ -49,7 +49,6 @@
|
|||
"express": "4.16.1",
|
||||
"express-http-proxy": "1.1.0",
|
||||
"lodash.defaults": "4.0.1",
|
||||
"newrelic": "1.25.4",
|
||||
"react-helmet": "5.2.0",
|
||||
"scratch-parser": "^5.0.0",
|
||||
"scratch-storage": "^0.5.1"
|
||||
|
|
Loading…
Reference in a new issue