+openplayground

This commit is contained in:
Max Howell 2023-07-20 13:31:10 -04:00
parent 91c6ec80cb
commit 7a442a47a3
Failed to extract signature
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,29 @@
#!/bin/bash
set -ex
source <(tea --magic=bash)
PORT=5432 #TODO find a port!
"$d"/bin/openplayground run --port $PORT &
PID=$!
# poll until a HEAD request succeeds
while ! curl -Is http://127.0.0.1:$PORT | grep -q "HTTP/1.1 200 OK"; do
if ! kill -0 $PID; then
echo "webui process died!"
exit 1
fi
sleep 1
done
# open the URL once the HEAD request succeeds
if test -n "$TEA_GUI"; then
echo "{\"xyz.tea\":{\"gui\":\"http://127.0.0.1:$PORT\"}}" >&2
else
open "http://127.0.0.1:$PORT"
fi
fg

View file

@ -0,0 +1,41 @@
distributable:
url: https://github.com/nat/openplayground/archive/7f3f790.tar.gz
strip-components: 1
versions:
- 2023.06.05
platforms: darwin
dependencies:
python.org: ~3.11
gnu.org/bash: '*'
build:
dependencies:
npmjs.com: '*'
python-poetry.org: ~1.4.1
pip.pypa.io: '*'
script:
- python-venv.py {{prefix}}/bin/openplayground
- run: |
npm i
npx parcel build src/index.html --no-cache --no-source-maps
working-directory: app
env:
NODE_ENV: production
# needs to be moved inside the server pkg
- mv app/dist {{prefix}}/venv/lib/python{{deps.python.org.version.marketing}}/site-packages/server/static
- cp props/entrypoint.sh {{prefix}}
entrypoint: ./entrypoint.sh
provides:
- bin/openplayground
test:
requires-qa: true
script: openplayground --help