-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.travis.yml
More file actions
137 lines (130 loc) · 5.12 KB
/
Copy path.travis.yml
File metadata and controls
137 lines (130 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
os: linux
dist: bionic
services:
- xvfb
notifications:
slack: ventureum-team:DSE8wxmLTenq0Yz17BrYBWg9
language: node_js
node_js:
- 12
stages:
- name: lint
if: type = pull_request
- name: test1
if: type = pull_request
- name: test2
if: type = pull_request
- name: test3
if: type = pull_request
- name: build and deploy
if: type = push AND (branch = master OR branch = release)
jobs:
include:
- stage: lint
script:
- npm run eslint
- npm run flow
- stage: test1
script:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- npm run test:e2e -t userSetting recipients receipt landing accountManagement
env:
- REACT_APP_INFURA_API_KEY=$REACT_APP_INFURA_API_KEY
- REACT_APP_CHAINSFER_API_ENDPOINT=https://test.api.chainsfr.com
- REACT_APP_E2E_TEST_MOCK_USER=true
- REACT_APP_E2E_TEST_TEST_MAIL_NAMESPACE=vnpkn
- REACT_APP_E2E_TEST_MAIL_TAG_SUFFIX=CI
- E2E_TEST_START_SERVER=true
- E2E_TEST_URL=http://localhost:3001
- E2E_TEST_METAMASK_PRIVATE_KEY=$E2E_TEST_METAMASK_PRIVATE_KEY
- E2E_TEST_TEST_MAIL_API_KEY=$E2E_TEST_TEST_MAIL_API_KEY
- REACT_APP_E2E_TEST_MOCK_USER_GOOGLE_ID=$REACT_APP_E2E_TEST_MOCK_USER_GOOGLE_ID
- stage: test2
script:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- npm run test:e2e -t directTransfer
env:
- REACT_APP_INFURA_API_KEY=$REACT_APP_INFURA_API_KEY
- REACT_APP_CHAINSFER_API_ENDPOINT=https://test.api.chainsfr.com
- REACT_APP_E2E_TEST_MOCK_USER=true
- REACT_APP_E2E_TEST_TEST_MAIL_NAMESPACE=vnpkn
- REACT_APP_E2E_TEST_MAIL_TAG_SUFFIX=CI
- E2E_TEST_START_SERVER=true
- E2E_TEST_URL=http://localhost:3001
- E2E_TEST_METAMASK_PRIVATE_KEY=$E2E_TEST_METAMASK_PRIVATE_KEY
- E2E_TEST_TEST_MAIL_API_KEY=$E2E_TEST_TEST_MAIL_API_KEY
- REACT_APP_E2E_TEST_MOCK_USER_GOOGLE_ID=$REACT_APP_E2E_TEST_MOCK_USER_GOOGLE_ID
- stage: test3
script:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- npm run test:e2e -t emailTransfer cancelTransfer receiveTransfer
env:
- REACT_APP_INFURA_API_KEY=$REACT_APP_INFURA_API_KEY
- REACT_APP_CHAINSFER_API_ENDPOINT=https://test.api.chainsfr.com
- REACT_APP_E2E_TEST_MOCK_USER=true
- REACT_APP_E2E_TEST_TEST_MAIL_NAMESPACE=vnpkn
- REACT_APP_E2E_TEST_MAIL_TAG_SUFFIX=CI
- E2E_TEST_START_SERVER=true
- E2E_TEST_URL=http://localhost:3001
- E2E_TEST_METAMASK_PRIVATE_KEY=$E2E_TEST_METAMASK_PRIVATE_KEY
- E2E_TEST_TEST_MAIL_API_KEY=$E2E_TEST_TEST_MAIL_API_KEY
- REACT_APP_E2E_TEST_MOCK_USER_GOOGLE_ID=$REACT_APP_E2E_TEST_MOCK_USER_GOOGLE_ID
- stage: build and deploy
before_install:
- chmod +x ./aws_config.sh
- ./aws_config.sh
install:
- npm ci
- pip install --user awscli
# setup sentry
- curl -sL https://sentry.io/get-cli/ | bash
- export SENTRY_RELEASE=$(sentry-cli releases propose-version)
- sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
- sentry-cli releases set-commits --auto $SENTRY_RELEASE
- sentry-cli releases finalize $SENTRY_RELEASE
script:
- npm run build:test
- mv ./build ./build_test
- npm run build:staging
- mv ./build ./build_staging
- npm run build:prod
- mv ./build ./build_prod
deploy:
- provider: s3
cache_control: 'max-age=0,no-cache,no-store,must-revalidate'
access_key_id: $S3_ACCESS_KEY
secret_access_key: $S3_SECRET
bucket: test.chainsfr.com
skip_cleanup: true
local_dir: build_test
region: us-east-1
acl: public_read
on:
branch: master
- provider: s3
cache_control: 'max-age=0,no-cache,no-store,must-revalidate'
access_key_id: $S3_ACCESS_KEY
secret_access_key: $S3_SECRET
bucket: testnet.chainsfr.com
skip_cleanup: true
local_dir: build_staging
region: us-east-1
acl: public_read
on:
branch: release
- provider: s3
cache_control: 'max-age=0,no-cache,no-store,must-revalidate'
access_key_id: $S3_ACCESS_KEY
secret_access_key: $S3_SECRET
bucket: app.chainsfr.com
skip_cleanup: true
local_dir: build_prod
region: us-east-1
acl: public_read
on:
branch: release
after_deploy:
- aws configure set preview.cloudfront true
- test $TRAVIS_BRANCH = "master" && aws cloudfront create-invalidation --distribution-id $TEST_DISTRIBUTION_ID --paths "/*"
- test $TRAVIS_BRANCH = "release" && aws cloudfront create-invalidation --distribution-id $STAGING_DISTRIBUTION_ID --paths "/*"
- test $TRAVIS_BRANCH = "release" && aws cloudfront create-invalidation --distribution-id $PROD_DISTRIBUTION_ID --paths "/*"