2020-11-03 08:01:10 +00:00
|
|
|
if: (branch = development) OR (branch = master) OR (type = pull_request) OR (tag IS present)
|
2020-12-09 19:45:06 +00:00
|
|
|
dist: focal
|
2018-03-12 08:30:03 +00:00
|
|
|
language: node_js
|
|
|
|
node_js:
|
2020-08-07 16:02:06 +00:00
|
|
|
- '12'
|
2018-03-12 08:30:03 +00:00
|
|
|
os:
|
|
|
|
- linux
|
2019-09-24 16:24:03 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
2020-05-20 19:15:21 +00:00
|
|
|
- env:
|
|
|
|
- REACT_APP_NETWORK='mainnet'
|
|
|
|
- STAGING_BUCKET_NAME=${STAGING_MAINNET_BUCKET_NAME}
|
2020-10-30 19:55:40 +00:00
|
|
|
- REACT_APP_SENTRY_DSN=${SENTRY_DSN_MAINNET}
|
|
|
|
- SENTRY_PROJECT=${SENTRY_PROJECT_MAINNET}
|
|
|
|
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_MAINNET}
|
2020-05-20 19:15:21 +00:00
|
|
|
- REACT_APP_GNOSIS_APPS_URL=${REACT_APP_GNOSIS_APPS_URL_PROD}
|
|
|
|
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
|
|
|
- env:
|
|
|
|
- REACT_APP_NETWORK='rinkeby'
|
2020-10-30 19:55:40 +00:00
|
|
|
- REACT_APP_SENTRY_DSN=${SENTRY_DSN_RINKEBY}
|
|
|
|
- SENTRY_PROJECT=${SENTRY_PROJECT_RINKEBY}
|
2020-10-19 11:38:12 +00:00
|
|
|
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_RINKEBY}
|
2020-05-20 19:15:21 +00:00
|
|
|
- REACT_APP_GNOSIS_APPS_URL=${REACT_APP_GNOSIS_APPS_URL_STAGING}
|
2020-10-18 19:48:22 +00:00
|
|
|
- env:
|
|
|
|
- REACT_APP_NETWORK='xdai'
|
|
|
|
- STAGING_BUCKET_NAME=${STAGING_XDAI_BUCKET_NAME}
|
2020-10-30 19:55:40 +00:00
|
|
|
- REACT_APP_SENTRY_DSN=${SENTRY_DSN_XDAI}
|
|
|
|
- SENTRY_PROJECT=${SENTRY_PROJECT_XDAI}
|
|
|
|
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_XDAI}
|
2020-11-02 08:45:59 +00:00
|
|
|
if: (branch = master) OR tag IS present
|
2020-10-28 12:10:40 +00:00
|
|
|
- env:
|
|
|
|
- REACT_APP_NETWORK='volta'
|
|
|
|
- STAGING_BUCKET_NAME=${STAGING_VOLTA_BUCKET_NAME}
|
2020-10-30 19:55:40 +00:00
|
|
|
- REACT_APP_SENTRY_DSN=${SENTRY_DSN_VOLTA}
|
|
|
|
- SENTRY_PROJECT=${SENTRY_PROJECT_VOLTA}
|
|
|
|
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_VOLTA}
|
2021-01-27 18:15:17 +00:00
|
|
|
if: (branch = master) OR tag IS present
|
2020-10-28 12:10:40 +00:00
|
|
|
- env:
|
|
|
|
- REACT_APP_NETWORK='energy_web_chain'
|
|
|
|
- STAGING_BUCKET_NAME=${STAGING_EWC_BUCKET_NAME}
|
2020-10-30 19:55:40 +00:00
|
|
|
- REACT_APP_SENTRY_DSN=${SENTRY_DSN_EWC}
|
|
|
|
- SENTRY_PROJECT=${SENTRY_PROJECT_EWC}
|
|
|
|
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_EWC}
|
2020-11-03 08:01:10 +00:00
|
|
|
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
2020-06-04 13:56:55 +00:00
|
|
|
cache:
|
2020-12-04 17:38:49 +00:00
|
|
|
npm: false
|
|
|
|
yarn: false
|
2020-09-29 15:14:30 +00:00
|
|
|
before_script:
|
|
|
|
- if [[ -n "$TRAVIS_TAG" ]]; then export REACT_APP_ENV='production'; fi;
|
2020-10-28 12:10:40 +00:00
|
|
|
- if [ $TRAVIS_PULL_REQUEST != "false" ]; then export PUBLIC_URL="/${REACT_APP_NETWORK}/app"; fi;
|
2018-07-30 13:20:05 +00:00
|
|
|
before_install:
|
|
|
|
# Needed to deploy pull request and releases
|
2019-12-16 12:26:21 +00:00
|
|
|
- sudo apt-get update
|
2020-12-09 19:45:06 +00:00
|
|
|
- sudo apt-get -y install python3-pip python3-dev libusb-1.0-0-dev libudev-dev
|
2018-07-30 13:20:05 +00:00
|
|
|
- pip install awscli --upgrade --user
|
2018-09-28 07:34:48 +00:00
|
|
|
script:
|
2020-09-24 14:04:35 +00:00
|
|
|
- yarn lint:check
|
|
|
|
- yarn prettier:check
|
|
|
|
- yarn test:coverage
|
|
|
|
- yarn build
|
2020-10-30 19:55:40 +00:00
|
|
|
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]] || [ -n "$TRAVIS_TAG" ]; then
|
2020-11-03 08:54:26 +00:00
|
|
|
echo "Upload sentry source maps";
|
2020-10-30 19:55:40 +00:00
|
|
|
yarn sentry-upload-sourcemaps;
|
|
|
|
else
|
|
|
|
echo "Skip source map upload";
|
|
|
|
fi;
|
2018-03-12 08:30:03 +00:00
|
|
|
after_success:
|
2018-07-30 13:20:05 +00:00
|
|
|
# Pull Request - Deploy it to a review environment
|
|
|
|
# Travis doesn't do deploy step with pull requests builds
|
|
|
|
- ./config/travis/deploy_pull_request.sh
|
|
|
|
# Releases (tagged commits) - Deploy it to a release environment
|
|
|
|
- ./config/travis/deploy_release.sh
|
2020-06-24 14:18:14 +00:00
|
|
|
- yarn coveralls
|
2018-07-30 13:20:05 +00:00
|
|
|
|
|
|
|
deploy:
|
2020-11-06 07:36:26 +00:00
|
|
|
# Development environment only on rinkeby
|
2020-05-20 19:15:21 +00:00
|
|
|
- provider: s3
|
|
|
|
bucket: $DEV_BUCKET_NAME
|
|
|
|
access_key_id: $AWS_ACCESS_KEY_ID
|
|
|
|
secret_access_key: $AWS_SECRET_ACCESS_KEY
|
|
|
|
skip_cleanup: true
|
2020-05-21 11:42:11 +00:00
|
|
|
local_dir: build
|
2020-10-18 19:48:22 +00:00
|
|
|
upload_dir: app
|
2020-05-20 19:15:21 +00:00
|
|
|
region: $AWS_DEFAULT_REGION
|
|
|
|
on:
|
|
|
|
branch: development
|
2020-11-06 07:36:26 +00:00
|
|
|
condition: $REACT_APP_NETWORK = rinkeby
|
2018-07-30 13:20:05 +00:00
|
|
|
|
2020-10-18 19:48:22 +00:00
|
|
|
# Staging environment
|
2020-05-20 19:15:21 +00:00
|
|
|
- provider: s3
|
|
|
|
bucket: $STAGING_BUCKET_NAME
|
|
|
|
access_key_id: $AWS_ACCESS_KEY_ID
|
|
|
|
secret_access_key: $AWS_SECRET_ACCESS_KEY
|
|
|
|
skip_cleanup: true
|
2020-05-21 11:42:11 +00:00
|
|
|
local_dir: build
|
2020-10-18 19:48:22 +00:00
|
|
|
upload_dir: current/app
|
2020-05-20 19:15:21 +00:00
|
|
|
region: $AWS_DEFAULT_REGION
|
|
|
|
on:
|
|
|
|
branch: master
|
2019-09-25 17:06:41 +00:00
|
|
|
|
2020-10-18 19:48:22 +00:00
|
|
|
# Prepare production deployment
|
2020-05-20 19:15:21 +00:00
|
|
|
- provider: s3
|
|
|
|
bucket: $STAGING_BUCKET_NAME
|
|
|
|
secret_access_key: $AWS_SECRET_ACCESS_KEY
|
|
|
|
access_key_id: $AWS_ACCESS_KEY_ID
|
|
|
|
skip_cleanup: true
|
2020-05-21 11:42:11 +00:00
|
|
|
local_dir: build
|
2020-10-18 19:48:22 +00:00
|
|
|
upload_dir: releases/$TRAVIS_TAG
|
2020-05-20 19:15:21 +00:00
|
|
|
region: $AWS_DEFAULT_REGION
|
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
- provider: script
|
|
|
|
script: ./config/travis/prepare_production_deployment.sh
|
|
|
|
on:
|
|
|
|
tags: true
|