2019-03-11 00:20:32 +05:30
|
|
|
language: node_js
|
2019-03-11 00:23:10 +05:30
|
|
|
node_js:
|
|
|
|
- "11"
|
|
|
|
|
2019-03-11 03:05:56 +05:30
|
|
|
cache:
|
|
|
|
yarn: true
|
|
|
|
directories:
|
|
|
|
- node_modules
|
2019-03-11 00:17:20 +05:30
|
|
|
|
2019-03-11 01:52:31 +05:30
|
|
|
addons:
|
|
|
|
ssh_known_hosts: account.ely.by
|
2019-03-11 00:17:20 +05:30
|
|
|
|
2019-03-11 02:32:38 +05:30
|
|
|
env:
|
2019-03-11 02:33:50 +05:30
|
|
|
global:
|
|
|
|
- GA_ID=UA-45299905-3
|
2019-05-22 21:31:12 +05:30
|
|
|
- SENTRY_CDN="https://95461d4ce6734b088c34fc4272d0a9e6@sentry.io/1463318"
|
|
|
|
- VERSION="${TRAVIS_TAG:-${TRAVIS_BRANCH}-${TRAVIS_COMMIT:0:7}}"
|
2019-03-11 02:32:38 +05:30
|
|
|
|
2019-03-11 01:52:31 +05:30
|
|
|
script:
|
|
|
|
- yarn lint
|
|
|
|
- yarn flow
|
|
|
|
- yarn test
|
2019-03-11 02:32:38 +05:30
|
|
|
- |
|
|
|
|
echo "
|
|
|
|
module.exports = {
|
|
|
|
version: '$VERSION',
|
|
|
|
ga: {id: '$GA_ID'},
|
|
|
|
sentryCdn: '$SENTRY_CDN',
|
|
|
|
};
|
|
|
|
" > config/env.js
|
2019-03-11 01:52:31 +05:30
|
|
|
- yarn build:quiet
|
|
|
|
|
|
|
|
before_deploy:
|
2019-04-06 22:57:08 +05:30
|
|
|
# Prepare ssh deployment
|
2019-03-11 01:52:31 +05:30
|
|
|
- openssl aes-256-cbc -K $encrypted_dd5ad7a5f201_key -iv $encrypted_dd5ad7a5f201_iv -in deploy_rsa.enc -out /tmp/deploy_rsa -d
|
|
|
|
- eval "$(ssh-agent -s)"
|
|
|
|
- chmod 600 /tmp/deploy_rsa
|
|
|
|
- ssh-add /tmp/deploy_rsa
|
2019-04-06 22:57:08 +05:30
|
|
|
# Removing unneeded files
|
|
|
|
- rm -rf dist/messages
|
2019-05-23 03:09:01 +05:30
|
|
|
- rm -rf dist/*.css.map
|
|
|
|
# Move all source maps to it's own directory
|
2019-05-23 03:13:29 +05:30
|
|
|
- mkdir -p source-maps
|
2019-05-23 03:22:26 +05:30
|
|
|
- mv dist/*.js.map source-maps/ 2>/dev/null; true
|
2019-05-23 03:09:01 +05:30
|
|
|
- cp dist/*.js source-maps/
|
2019-04-06 22:57:08 +05:30
|
|
|
# Creating tar.gz and zip archives
|
|
|
|
- cd dist
|
2019-05-22 21:46:07 +05:30
|
|
|
- tar -zcf ../dist.tar.gz --exclude="*.map" *
|
|
|
|
- zip -rq ../dist.zip * -x "*.map"
|
2019-04-06 22:57:08 +05:30
|
|
|
- cd ..
|
2019-03-11 01:52:31 +05:30
|
|
|
|
|
|
|
deploy:
|
2019-04-06 20:23:47 +05:30
|
|
|
- provider: releases
|
|
|
|
api_key: "$GITHUB_TOKEN"
|
2019-04-06 22:57:08 +05:30
|
|
|
file:
|
|
|
|
- dist.tar.gz
|
|
|
|
- dist.zip
|
2019-04-06 20:23:47 +05:30
|
|
|
skip_cleanup: true
|
|
|
|
draft: true
|
|
|
|
on:
|
|
|
|
branch: master
|
|
|
|
|
|
|
|
- provider: script
|
|
|
|
skip_cleanup: true
|
|
|
|
script: echo "put -r $TRAVIS_BUILD_DIR/dist/* accounts-frontend/" | sftp deploy@account.ely.by
|
|
|
|
on:
|
2019-05-21 21:14:21 +05:30
|
|
|
branch: master
|
2019-05-22 21:31:12 +05:30
|
|
|
|
|
|
|
- provider: script
|
|
|
|
skip_cleanup: true
|
|
|
|
script: >
|
2019-05-22 21:51:11 +05:30
|
|
|
curl -sL https://sentry.io/get-cli/ | bash &&
|
2019-05-22 21:31:12 +05:30
|
|
|
sentry-cli releases new -p $SENTRY_PROJECT $VERSION &&
|
|
|
|
sentry-cli releases set-commits --auto $VERSION &&
|
2019-05-23 03:09:01 +05:30
|
|
|
sentry-cli releases files $VERSION upload-sourcemaps source-maps &&
|
2019-05-22 21:31:12 +05:30
|
|
|
sentry-cli releases deploys $VERSION new -e "Production"
|
|
|
|
on:
|
|
|
|
branch: master
|