spec: Add .gear/generate to re-generate React for llama-server

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Vitaly Chikunov 2025-09-02 08:26:30 +03:00
parent 8ef7a5cd9e
commit 7bba0c56dd

23
.gear/generate Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
# Re-generate React index.html.gz for llama-server
cd "$(git rev-parse --show-toplevel)"
set -exu
hsh --ini
hsh-install git npm
hsh-copy . build
hsh-run --rooter -- bash -c 'echo nameserver 1.1.1.1 > /etc/resolv.conf'
share_network=1 \
hsh-run --mountpoints=/proc -- bash -xe <<-EOF
cd /usr/src/build
cd tools/server/webui
npm i
npm audit fix
npm run build
EOF
f=tools/server/public/index.html.gz
hsh-run -- base64 "/usr/src/build/$f" | base64 -d > "$f"
git add "$f"
git diff --cached --quiet || git commit -m "ALT: Re-generate $f"