forked from MyEtherWallet/MyEtherWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
161 lines (161 loc) · 10.1 KB
/
.travis.yml
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
language: node_js
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libcairo2-dev
- libjpeg8-dev
- libpango1.0-dev
- libgif-dev
- librsvg2-dev
- g++-4.9
node_js:
- '8.16.0'
sudo: required
dist: xenial
cache:
directories:
- node_modules
git:
depth: 1
before_cache:
- sudo rm -rf node_modules/.cache
- sudo rm -rf node_modules/websocket/.git
install:
- node package-audit.js
- npm install npm@6.9 -g
- npm install
env:
global:
- NODE_OPTIONS="--max_old_space_size=4096"
- CXX=g++-4.9
- ci_env=`bash <(curl -s https://codecov.io/env)`
- secure: S8/CyHiA4M/omHrfvUXmZeLun43yGMg3qYsSzI8HI1Wr+G8xrz1qA7LgehEGx40iTBge1NSzfr7ZyKhGGYJ6dAIGxxk7+nyoIrdyUqrkWgNgYHsZdJLnYTZhvrCSEwURW4WMCFR8LJVO/84ltvS9+hPvwtGPPuFn9BDXf9O9ril0guxkm1WijSdmpFFyMrUBZDIDw9lc5D9QTRw1gpkXYzboMvPE6BO+HQoGxid2NFqTYw9dOyNSFXfbD2ni7Z+hZRxU0YO66TndFtvXDHJvvhnMEdfHrG3xunq3Zml+PVIaCI50dNQUo88ajiZiMddCkf6b4UROQGtMmbE5t7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Ck/Az42re07T/7HCFZgjbJTRpMkHWrIKJ140PFycciuoo/+R/QLv3cYOEymhJQncJUZDCRS8f15w5C+kguP89A61GJIUDLaUfXBcrYxWnRXrUvAJGTfOOLQ7q47xQ5Pif8niFDfk0ptyRXpqR4HYoveHSr3IZnUnlKBK5Dpe5F2sPb0wH/2YkT1P55VpJ766lwoZtivmXDtX9EvLiGO0EV8YSd0njHTXKq2sgwJvq9FVxfkYPwG818TnyoSEfx4724Z6OoeyOD3CWMT+Wxp+WrNLHhSt6N4X6k8IqwoJAxbxZbR2q4a3wY11tOb0DPuqmsDCs0f4RpbKae0bvcMCu1szyuplb6+EfflXdCDj+dokaFb0g9MYbM4RJGsxRCmucYreBG+839FiJ4iNhbzw48u12aBauUYUkjHs4IUfaMxOD3mY0vDrK3hVeVcRbdYbqNN4hQ9nEmmQ3EcYCmDofbW4mZfO+14GZaj44DIiPfJ0/rKDojjjLYqtYqaIaBoqEmo0EVcmqpiStb+8/ilw4qDvWXhwj4ebmnJzR0=
branches:
except:
- gh-pages
stages:
- name: run on pull requests
if: type = pull_request and fork = true
- name: add to mewbuilds
if: type != pull_request and tag IS blank
- name: add to codecov
if: type != pull_request and tag IS blank
- name: add to mewbuilds develop
if: branch = develop and type != pull_request
- name: create release
if: branch =~ /^v.*$/
- name: deploy to production
if: branch =~ /^v.*$/
- name: deploy to production history
if: branch =~ /^v.*$/
jobs:
fast_finish: true
include:
- stage: run on pull requests
script:
- npm run lint && npm run codecov && npm run build:history
- stage: add to codecov
script:
- npm run codecov
- stage: add to mewbuilds develop
before_script:
- npm run build:history
- pip install --user awscli
script:
- aws s3 sync dist/ s3://mewbuilds/develop/ --delete --cache-control max-age=172800,public
--acl public-read
- aws s3 cp s3://mewbuilds/develop/service-worker.js s3://mewbuilds/develop/service-worker.js
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate
--content-type application/javascript --acl public-read
- aws s3 cp s3://mewbuilds/develop/index.html s3://mewbuilds/develop/index.html
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate
--content-type text/html --acl public-read
- stage: add to mewbuilds
before_script:
- npm run build:hash
- pip install --user awscli
- ssh-keyscan -H $IPFS_NODE >> $HOME/.ssh/known_hosts
script:
- openssl aes-256-cbc -K $encrypted_2bd32a0810e2_key -iv $encrypted_2bd32a0810e2_iv
-in ssh-keys.tar.enc -out ssh-keys.tar -d
- tar xvf ssh-keys.tar
- chmod 400 ipfs-host.pem
- hashOut=`tar -cjvf - -C dist/ . | ssh -i ipfs-host.pem ubuntu@$IPFS_NODE ./ipfs-publish.sh
--`
- HASH=`echo $hashOut | sed -n 's:.*<hash>\(.*\)</hash>.*:\1:p'`
- aws s3 sync --delete --acl public-read dist/ s3://mewbuilds/build/$TRAVIS_COMMIT
- aws s3 cp s3://mewbuilds/build/$TRAVIS_COMMIT/service-worker.js s3://mewbuilds/build/$TRAVIS_COMMIT/service-worker.js
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate
--content-type application/javascript --acl public-read
- aws s3 cp s3://mewbuilds/build/$TRAVIS_COMMIT/index.html s3://mewbuilds/build/$TRAVIS_COMMIT/index.html
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate
--content-type text/html --acl public-read
- cd dist && zip -r ../MyEtherWallet-$TRAVIS_COMMIT.zip * && cd ..
- VIRUS_TOTAL_URL=`curl -s -F "file=@MyEtherWallet-$TRAVIS_COMMIT.zip" -F apikey=${VIRUS_TOTAL_API_KEY} https://www.virustotal.com/vtapi/v2/file/scan | jq --raw-output '.permalink'`
after_success:
- |
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
-d "{\"body\": \"Copy of this build can be found at <br/>https://builds.myetherwallet.com/build/${TRAVIS_COMMIT}/index.html<br/> \
https://www.cloudflare-ipfs.com/ipfs/$HASH <br/> \
Virus Total analysis <br/> \
$VIRUS_TOTAL_URL\"}" \
"https://api.github.com/repos/${TRAVIS_REPO_SLUG}/commits/${TRAVIS_COMMIT}/comments"
- stage: create release
script: skip
before_deploy:
- npm run build:offline
- openssl aes-256-cbc -K $encrypted_2bd32a0810e2_key -iv $encrypted_2bd32a0810e2_iv
-in ssh-keys.tar.enc -out ssh-keys.tar -d
- tar xvf ssh-keys.tar
- gpg --allow-secret-key-import --import mew-sign.gpg
deploy:
provider: script
script: bash ./release.sh $TRAVIS_TAG $GITHUB_TOKEN $TRAVIS_REPO_SLUG true
skip_cleanup: true
on:
tags: true
branch: master
- stage: deploy to production
script: skip
before_deploy:
- npm run build:hash
deploy:
provider: pages
skip-cleanup: true
github-token: '$GITHUB_TOKEN'
keep-history: false
local-dir: './dist'
on:
branch: master
tags: true
target-branch: gh-pages
- stage: deploy to production history
script: skip
before_deploy:
- npm run build:history
- pip install --user awscli
- aws s3 sync dist/ s3://mewbuilds/staging/ --delete --cache-control max-age=172800,public
--acl public-read
- aws s3 cp s3://mewbuilds/staging/service-worker.js s3://mewbuilds/staging/service-worker.js
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate
--content-type application/javascript --acl public-read
- aws s3 cp s3://mewbuilds/staging/index.html s3://mewbuilds/staging/index.html
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate
--content-type text/html --acl public-read
deploy:
provider: pages
skip-cleanup: true
github-token: '$GITHUB_TOKEN'
keep-history: false
local-dir: './dist'
on:
branch: master
tags: true
target-branch: gh-pages-history