2021-02-24 16:24:25 +00:00
|
|
|
# if: (branch = development) OR (branch = master) OR (type = pull_request) OR (tag IS present)
|
|
|
|
if: (branch = master) 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:
|
2021-02-24 16:24:25 +00:00
|
|
|
# include:
|
|
|
|
# - env:
|
|
|
|
# - REACT_APP_NETWORK='mainnet'
|
|
|
|
# - STAGING_BUCKET_NAME=${STAGING_MAINNET_BUCKET_NAME}
|
|
|
|
# - REACT_APP_SENTRY_DSN=${SENTRY_DSN_MAINNET}
|
|
|
|
# - SENTRY_PROJECT=${SENTRY_PROJECT_MAINNET}
|
|
|
|
# - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_MAINNET}
|
|
|
|
# - 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'
|
|
|
|
# - REACT_APP_SENTRY_DSN=${SENTRY_DSN_RINKEBY}
|
|
|
|
# - SENTRY_PROJECT=${SENTRY_PROJECT_RINKEBY}
|
|
|
|
# - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_RINKEBY}
|
|
|
|
# - REACT_APP_GNOSIS_APPS_URL=${REACT_APP_GNOSIS_APPS_URL_STAGING}
|
|
|
|
# if: (branch = development AND NOT type = pull_request) OR (branch = master) OR tag IS present
|
|
|
|
# - env:
|
|
|
|
# - REACT_APP_NETWORK='xdai'
|
|
|
|
# - STAGING_BUCKET_NAME=${STAGING_XDAI_BUCKET_NAME}
|
|
|
|
# - REACT_APP_SENTRY_DSN=${SENTRY_DSN_XDAI}
|
|
|
|
# - SENTRY_PROJECT=${SENTRY_PROJECT_XDAI}
|
|
|
|
# - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_XDAI}
|
|
|
|
# if: (branch = master) OR tag IS present
|
|
|
|
# - env:
|
|
|
|
# - REACT_APP_NETWORK='volta'
|
|
|
|
# - STAGING_BUCKET_NAME=${STAGING_VOLTA_BUCKET_NAME}
|
|
|
|
# - REACT_APP_SENTRY_DSN=${SENTRY_DSN_VOLTA}
|
|
|
|
# - SENTRY_PROJECT=${SENTRY_PROJECT_VOLTA}
|
|
|
|
# - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_VOLTA}
|
|
|
|
# if: (branch = master) OR tag IS present
|
|
|
|
# - env:
|
|
|
|
# - REACT_APP_NETWORK='energy_web_chain'
|
|
|
|
# - STAGING_BUCKET_NAME=${STAGING_EWC_BUCKET_NAME}
|
|
|
|
# - REACT_APP_SENTRY_DSN=${SENTRY_DSN_EWC}
|
|
|
|
# - SENTRY_PROJECT=${SENTRY_PROJECT_EWC}
|
|
|
|
# - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_EWC}
|
|
|
|
# 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
|
2021-02-10 10:51:20 +00:00
|
|
|
yarn: true
|
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
|
2021-02-24 16:24:25 +00:00
|
|
|
# - sudo apt-get update
|
|
|
|
# - sudo apt-get -y install python3-pip python3-dev libusb-1.0-0-dev libudev-dev
|
|
|
|
# - pip install awscli --upgrade --user
|
2018-09-28 07:34:48 +00:00
|
|
|
script:
|
2020-09-24 14:04:35 +00:00
|
|
|
- yarn prettier:check
|
2021-02-24 16:24:25 +00:00
|
|
|
# - yarn test:coverage
|
|
|
|
# - yarn build
|
|
|
|
# - if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]] || [ -n "$TRAVIS_TAG" ]; then
|
|
|
|
# echo "Upload sentry source maps";
|
|
|
|
# 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
|
2021-02-24 16:24:25 +00:00
|
|
|
# - ./config/travis/deploy_pull_request.sh
|
2018-07-30 13:20:05 +00:00
|
|
|
# Releases (tagged commits) - Deploy it to a release environment
|
2021-02-24 16:24:25 +00:00
|
|
|
# - ./config/travis/deploy_release.sh
|
|
|
|
# - yarn coveralls
|
2018-07-30 13:20:05 +00:00
|
|
|
|
|
|
|
deploy:
|
2020-11-06 07:36:26 +00:00
|
|
|
# Development environment only on rinkeby
|
2021-02-24 16:24:25 +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
|
|
|
|
# local_dir: build
|
|
|
|
# upload_dir: app
|
|
|
|
# region: $AWS_DEFAULT_REGION
|
|
|
|
# on:
|
|
|
|
# branch: development
|
|
|
|
# condition: $REACT_APP_NETWORK = rinkeby
|
2018-07-30 13:20:05 +00:00
|
|
|
|
2020-10-18 19:48:22 +00:00
|
|
|
# Staging environment
|
2021-02-24 16:24:25 +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
|
|
|
|
# local_dir: build
|
|
|
|
# upload_dir: current/app
|
|
|
|
# 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
|
2021-02-24 16:24:25 +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
|
|
|
|
# local_dir: build
|
|
|
|
# upload_dir: releases/$TRAVIS_TAG
|
|
|
|
# region: $AWS_DEFAULT_REGION
|
|
|
|
# on:
|
|
|
|
# tags: true
|
|
|
|
# - provider: script
|
|
|
|
# script: ./config/travis/prepare_production_deployment.sh
|
|
|
|
# on:
|
|
|
|
# tags: true
|