spec: Switch to .gear/npm-build hook
This commit is contained in:
parent
ed4178bf90
commit
79a2c10800
2 changed files with 5 additions and 36 deletions
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Re-generate React index.html.gz for llama-server
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
set -exu -o pipefail
|
||||
hsh --ini
|
||||
hsh-install git npm
|
||||
hsh-copy . build
|
||||
hsh-run --rooter -- bash -c 'echo nameserver 1.1.1.1 > /etc/resolv.conf'
|
||||
hsh-run --rooter -- bash -c 'echo precedence ::ffff:0:0/96 100 > /etc/gai.conf'
|
||||
f=tools/server/public/index.html.gz
|
||||
printf '%s\n\n' "ALT: Re-generate $f" > .git/NPM_I.log
|
||||
share_network=1 \
|
||||
hsh-run --mountpoints=/proc -- bash -e <<-EOF |& tee -a .git/NPM_I.log
|
||||
export NO_PROXY=${NO_PROXY@Q} HTTPS_PROXY=${HTTPS_PROXY@Q}
|
||||
set -x
|
||||
mkdir ~/.npm-global
|
||||
npm config set prefix ~/.npm-global
|
||||
npm install -g @aikidosec/safe-chain
|
||||
PATH=~/.npm-global/bin:\$PATH
|
||||
|
||||
cd /usr/src/build
|
||||
rm $f
|
||||
cd tools/server/webui
|
||||
aikido-npm ci --ignore-scripts
|
||||
aikido-npm audit --audit-level=critical fix
|
||||
du -sh node_modules
|
||||
|
||||
npm run build
|
||||
EOF
|
||||
hsh-run -- base64 "/usr/src/build/$f" | base64 -d > "$f"
|
||||
git add "$f"
|
||||
git diff --cached --quiet || git commit -F .git/NPM_I.log
|
||||
gear-checklist --update generate-index.html
|
||||
beep
|
||||
5
.gear/npm-build
Executable file
5
.gear/npm-build
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
workdir=tools/server/webui
|
||||
target=tools/server/public/index.html.gz
|
||||
aikido-npm ci --ignore-scripts
|
||||
aikido-npm audit --audit-level=critical fix
|
||||
npm run build
|
||||
Loading…
Add table
Add a link
Reference in a new issue