This commit is contained in:
kento2 2026-08-07 00:37:40 +02:00
parent ad2717b6d2
commit 670eba418c
4 changed files with 36 additions and 11 deletions

View file

@ -2,9 +2,8 @@ def _dev_server_impl(ctx):
script = ctx.actions.declare_file(ctx.label.name + "_runner")
content = """
#!/bin/sh
set -eux
set -eu
echo hi\n
cp -f '%s' server.jar
printf eula=true > eula.txt
mkdir -p plugins
@ -13,7 +12,19 @@ for plugin in %s
do
cp -v \"$plugin\" plugins/
done
exec java -jar server.jar --nogui %s
mkdir -p postgres-data
podman run \
--rm \
--name scrow-postgres-dev \
-p 5432:5432 \
-v ./postgres-data/:/data \
-e POSTGRES_USER=postgres \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-d \
docker.io/postgres:alpine || true
echo "Starting paper server in $PWD"
exec env HOST_POSTGRES='jdbc:postgresql://127.0.0.1:5432/postgres' java -jar server.jar --nogui %s
""" % (
ctx.file.server_jar.short_path,
" ".join([p.short_path for p in ctx.files.plugins]),