eco2d/web/deploy.sh

42 lines
793 B
Bash
Raw Normal View History

2022-09-11 19:58:30 +00:00
#!/bin/bash
set -xe
if [ ! -d "build_web" ]; then
echo "Build directory not found. Run setup_web.sh first."
exit 1
fi
if [ ! -d "butler" ]; then
mkdir butler
wget https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default -O butler.zip
mv butler.zip butler/
pushd butler/
unzip butler.zip
rm -rf butler.zip
chmod +x ./butler
./butler -V
popd
fi
2022-09-11 23:52:01 +00:00
# Build the project
web/build.sh
2022-09-11 19:58:30 +00:00
# Package all assets
2022-09-12 07:02:12 +00:00
if [ ! -f "build_web/index.html" ]; then
2022-09-11 19:58:30 +00:00
echo "Build data not found. Compilation errors?"
exit 1
fi
2022-09-27 14:19:57 +00:00
APP=${1:-eco2d}
2022-09-12 07:02:12 +00:00
mkdir -p deploy_web
2022-09-27 14:19:57 +00:00
cp build_web/$APP.* deploy_web/
2022-09-12 07:02:12 +00:00
cp build_web/index.html deploy_web/
2022-09-11 19:58:30 +00:00
# Deploy to itch.io
2022-09-27 14:19:57 +00:00
./butler/butler push deploy_web/ zaklaus/$APP:html-latest
2022-09-11 19:58:30 +00:00
# Teardown
rm -rf deploy_web