forked from Schmavery/reprocessing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·49 lines (40 loc) · 1.54 KB
/
deploy.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.54 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
set -e
# Build with ClientWrapper
./node_modules/.bin/bsb -clean-world
cp ./src/Reprocessing_ClientWrapper.re src/Reprocessing_ClientWrapper.re.bak && cp ./webenv-artifacts/Reprocessing_ClientWrapper.re ./src/Reprocessing_ClientWrapper.re
./node_modules/.bin/bsb -make-world -backend js
mv ./src/Reprocessing_ClientWrapper.re.bak ./src/Reprocessing_ClientWrapper.re
# Copy to js build location
mkdir -p ./webenv-artifacts/webenv-build
mkdir -p ./webenv-artifacts/transfer
cp ./lib/js/src/* ./webenv-artifacts/webenv-build
cp ./webenv-artifacts/entrypoint.js ./webenv-artifacts/webenv-build
# Build browserified bundle
./node_modules/.bin/browserify ./webenv-artifacts/webenv-build/entrypoint.js -o ./webenv-artifacts/transfer/reprocessing-bundle.js
cp ./webenv-artifacts/Reprocessing_Ext.re ./webenv-artifacts/transfer
curr_branch=$(git rev-parse --abbrev-ref HEAD)
git stash
git checkout gh-pages
cp ./webenv-artifacts/transfer/reprocessing-bundle.js reprocessing.js
cp ./webenv-artifacts/transfer/Reprocessing_Ext.re Reprocessing_Ext.re
if [ $1 == "--non-interactive" ]
then
git add reprocessing.js Reprocessing_Ext.re
git commit -m "Update reprocessing bundle."
git push
git checkout $curr_branch
git stash pop
exit 0
fi
after=$(git rev-parse --abbrev-ref HEAD)
echo "Committing update to $after\n"
read -p "Are you sure? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
git add reprocessing.js Reprocessing_Ext.re
git commit -m "Update reprocessing bundle."
git push
fi
git checkout $curr_branch
git stash pop