2018-07-30 13:20:05 +00:00
|
|
|
if: (branch = development) OR (branch = master) OR (type = pull_request) OR (tag IS present)
|
2018-08-09 09:38:43 +00:00
|
|
|
sudo: required
|
2020-09-24 14:04:35 +00:00
|
|
|
dist: bionic
|
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}
|
|
|
|
- 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_GNOSIS_APPS_URL=${REACT_APP_GNOSIS_APPS_URL_STAGING}
|
2020-06-04 13:56:55 +00:00
|
|
|
cache:
|
|
|
|
yarn: true
|
2020-09-29 15:14:30 +00:00
|
|
|
before_script:
|
|
|
|
- if [[ -n "$TRAVIS_TAG" ]]; then export REACT_APP_ENV='production'; 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-05-20 19:15:21 +00:00
|
|
|
- sudo apt-get -y install python-pip python-dev libusb-1.0-0-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
|
|
|
|
#- bash ./config/travis/build.sh
|
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:
|
|
|
|
# Development environment
|
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-05-20 19:15:21 +00:00
|
|
|
upload-dir: app
|
|
|
|
region: $AWS_DEFAULT_REGION
|
|
|
|
on:
|
|
|
|
branch: development
|
2018-07-30 13:20:05 +00:00
|
|
|
|
2020-05-20 19:15:21 +00:00
|
|
|
# Staging environment
|
|
|
|
- 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-05-20 19:15:21 +00:00
|
|
|
upload-dir: current/app
|
|
|
|
region: $AWS_DEFAULT_REGION
|
|
|
|
on:
|
|
|
|
branch: master
|
2019-09-25 17:06:41 +00:00
|
|
|
|
2020-05-20 19:15:21 +00:00
|
|
|
# Prepare production deployment
|
|
|
|
- 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-05-20 19:15:21 +00:00
|
|
|
upload-dir: releases/$TRAVIS_TAG
|
|
|
|
region: $AWS_DEFAULT_REGION
|
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
- provider: script
|
|
|
|
script: ./config/travis/prepare_production_deployment.sh
|
|
|
|
on:
|
|
|
|
tags: true
|