rework web scripts
parent
f06e9d7dd2
commit
9563e0654f
|
@ -3,6 +3,7 @@ build_rel
|
||||||
build_web
|
build_web
|
||||||
emsdk
|
emsdk
|
||||||
deploy_web
|
deploy_web
|
||||||
|
run_web
|
||||||
butler
|
butler
|
||||||
screenshots
|
screenshots
|
||||||
build.bat
|
build.bat
|
||||||
|
|
17
host_web.sh
17
host_web.sh
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Run as "source web_host.sh" to set up environment variables
|
|
||||||
|
|
||||||
# Prompt for URL
|
|
||||||
read -p "Enter URL: " URL
|
|
||||||
|
|
||||||
# Expose URL to environment
|
|
||||||
export ECO2D_SERVER_URL=${URL/https:\/\//}build_web
|
|
||||||
echo ${ECO2D_SERVER_URL}
|
|
||||||
|
|
||||||
# Symlink sources
|
|
||||||
if [ ! -d "build_web/${ECO2D_SERVER_URL}" ]; then
|
|
||||||
mkdir -p "build_web/${ECO2D_SERVER_URL}"
|
|
||||||
pushd build_web
|
|
||||||
ln -s "/workspaces/eco2d/code" "${ECO2D_SERVER_URL/build_web/}/code"
|
|
||||||
popd
|
|
||||||
fi
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
python -m http.server --directory build_web --bind 127.0.0.1
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Run as "source web/host.sh" to set up environment variables
|
||||||
|
|
||||||
|
# Prompt for URL
|
||||||
|
read -p "Enter URL: " URL
|
||||||
|
|
||||||
|
# Expose URL to environment
|
||||||
|
export ECO2D_SERVER_URL=${URL/https:\/\//}run_web
|
||||||
|
echo ${ECO2D_SERVER_URL}
|
||||||
|
|
||||||
|
# Symlink sources
|
||||||
|
if [ ! -d "run_web/${ECO2D_SERVER_URL}" ]; then
|
||||||
|
mkdir -p "run_web/${ECO2D_SERVER_URL/run_/build_}"
|
||||||
|
pushd run_web
|
||||||
|
ln -s "/workspaces/eco2d/code" "${ECO2D_SERVER_URL/run_web/}/code"
|
||||||
|
ln -s "/workspaces/eco2d/build_web/_deps" "${ECO2D_SERVER_URL/run_web/}build_web/_deps"
|
||||||
|
popd
|
||||||
|
fi
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
cmake --build build_web --parallel
|
||||||
|
|
||||||
|
pushd build_web
|
||||||
|
if [ -f "eco2d.html" ]; then
|
||||||
|
mv eco2d.html index.html
|
||||||
|
fi
|
||||||
|
popd
|
|
@ -20,10 +20,12 @@ if [ ! -d "butler" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build web
|
# Build web
|
||||||
if [ -f "build_web/eco2d.html" ]; then
|
if [ -f "build_web/index.html" ]; then
|
||||||
rm -rf build_web/eco2d.html
|
rm -rf build_web/index.html
|
||||||
fi
|
fi
|
||||||
cmake --build build_web
|
|
||||||
|
# Build the project
|
||||||
|
web/build.sh
|
||||||
|
|
||||||
# Package all assets
|
# Package all assets
|
||||||
if [ ! -f "build_web/eco2d.html" ]; then
|
if [ ! -f "build_web/eco2d.html" ]; then
|
||||||
|
@ -33,9 +35,7 @@ fi
|
||||||
|
|
||||||
mkdir deploy_web
|
mkdir deploy_web
|
||||||
cp build_web/eco2d.* deploy_web/
|
cp build_web/eco2d.* deploy_web/
|
||||||
pushd deploy_web/
|
cp buiid_web/index.html deploy_web/
|
||||||
mv eco2d.html index.html
|
|
||||||
popd
|
|
||||||
|
|
||||||
# Deploy to itch.io
|
# Deploy to itch.io
|
||||||
./butler/butler push deploy_web/ zaklaus/eco2d:html-latest
|
./butler/butler push deploy_web/ zaklaus/eco2d:html-latest
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
if [ -d "run_web" ]; then
|
||||||
|
rm -rf run_web
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir run_web
|
||||||
|
cp build_web/eco2d.* run_web/
|
||||||
|
cp build_web/index.html run_web/
|
||||||
|
|
||||||
|
python -m http.server --directory run_web --bind 127.0.0.1
|
Loading…
Reference in New Issue