-
Notifications
You must be signed in to change notification settings - Fork 5k
/
e2e.cdn.sh
executable file
·31 lines (20 loc) · 1.04 KB
/
e2e.cdn.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
#!/usr/bin/env bash
# --------------------------------------------------------------------
# Prepares a small test site that uses the packages/web3/dist/min
# --------------------------------------------------------------------
if [ -z "$CI" ]; then
echo "======================================================================"
echo "This script prepares a test site for Netlify. Only run in CI. "
echo "======================================================================"
exit 1
fi
echo "======================================================================"
echo "Preparing test site for web3-staging.netlify.app "
echo "======================================================================"
cp packages/web3/dist/web3.min.js scripts/html
cd scripts/html
BUNDLE_SIZE=$(wc -c web3.min.js | awk '{print $1}')
# Mark file with current commit, branch, and bundle size.
sed -i "s|__COMMIT_HASH__|$COMMIT_REF|g" index.html
sed -i "s|__BRANCH__|$BRANCH|g" index.html
sed -i "s|__BUNDLE_SIZE__|$BUNDLE_SIZE|g" index.html