mapcomplete/deploy.sh

47 lines
1.2 KiB
Bash
Raw Normal View History

2020-07-16 15:29:52 +00:00
#! /bin/bash
mkdir assets/generated
ts-node createLayouts.ts
find -name '*.png' | parallel optipng '{}'
2020-07-16 15:29:52 +00:00
npm run build
2020-08-22 01:15:42 +00:00
2020-09-04 23:40:43 +00:00
if [[ $1 == "production" ]]
then
echo "DEPLOYING TO PRODUCTION!"
rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/*
cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
cd /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
else
echo "Testversion deploy"
rm -rf /home/pietervdvn/git/pietervdvn.github.io/Staging/*
cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/Staging/
cd /home/pietervdvn/git/pietervdvn.github.io/Staging/
fi
git add . && git commit -m "New mapcomplete version" && git push
2020-08-22 01:15:42 +00:00
cd -
# clean up the mess we made
# rm *.js
# rm Logic/*.js
# rm Logic/*.js
# rm Logic/*/*.js
# rm Logic/*/*/*.js
# rm UI/*.js
# rm UI/*/*.js
# rm UI/*/*/*.js
# rm Customizations/*.js
# rm Customizations/*/*.js
# rm Customizations/*/*/*.js
rm *.webmanifest
rm assets/generated/*
for f in ./*.html; do
if [[ "$f" == "./index.html" ]] || [[ "$f" == "./land.html" ]] || [[ "$f" == "./test.html" ]] || [[ "$f" == "./preferences.html" ]] || [[ "$f" == "./customGenerator.html" ]]
then
echo "Not removing $f"
else
rm $f
fi
done