-
Notifications
You must be signed in to change notification settings - Fork 15
/
jenkins.sh
executable file
·69 lines (52 loc) · 1.84 KB
/
jenkins.sh
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
#!/bin/bash -ex
export SENTRY_ORG=loom-network
export SENTRY_PROJECT=loomgames-frontend
#export SENTRY_AUTH_TOKEN= #this is on the CI SERVER
PRESET_MOBILE="m-dashboard.dappchains.com"
PRESET_DEV="dev-dashboard.dappchains.com"
PRESET_STAGE="stage-dashboard.dappchains.com" #future production
PRESET_PROD="dashboard.dappchains.com"
FAUCET_PATH='dashboard.dappchains.com'
ALT_FAUCET_PATH="wallet.loomx.io"
# You probably don't need to modify this stuff.
if [ "$GIT_BRANCH" == '' ]; then
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
fi
BRANCH_CHOICE=${1:-$GIT_BRANCH}
# This is where you add any extra branches you want to recognise.
case "$BRANCH_CHOICE" in
origin/master|master)
FAUCET_PATH="${PRESET_PROD}"
;;
origin/staging|staging)
FAUCET_PATH="${PRESET_STAGE}"
;;
origin/develop|develop)
FAUCET_PATH="${PRESET_DEV}"
;;
origin/mobile-ui|mobile-ui)
FAUCET_PATH="${PRESET_MOBILE}"
;;
*)
echo "Sanity check failed. You are trying to deploy from branch $GIT_BRANCH. Is that intended? If so add it to jenkins.sh so that it does the right thing."
exit 1
;;
esac
bash -e ./remove_src.sh
yarn install
#bundle install --path vendor/bundle
# yarn
# export AWS_DEFAULT_INDEX_DOC=index.html
echo "Using bucket $BUCKET_PATH."
# bundle exec middleman s3_sync --build --bucket=$BUCKET_PATH
rm -rf dist
export NODE_OPTIONS="--max-old-space-size=8048"
yarn run build
REV=`git rev-parse --short HEAD`
export RELEASE=$REV
./node_modules/@sentry/cli/sentry-cli releases new $REV
#temp hack to have all the cards !
mkdir -p dist/faucet
cd dist
aws s3 sync . s3://$FAUCET_PATH --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude "*.html" --exclude "*" --include "*.html"
aws s3 sync . s3://$FAUCET_PATH --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude "*.html" --cache-control 'max-age=86400'