chore(script): add run-registry-tests
This commit is contained in:
parent
8b37189829
commit
0c28231c3b
@ -320,6 +320,7 @@ All optional — defaults work for most setups:
|
||||
- Keep backend ports closed publicly once DNS and NSG rules are aligned. Docker-internal service discovery remains unchanged.
|
||||
- `ollama.bytelyst.com` reverse proxies to the host Ollama listener on `172.17.0.1:11434`; keep it restricted to trusted cross-VM or internal clients.
|
||||
- **Network guard:** run `source scripts/switch-network.sh` and honor `NETWORK=corp|home` before running pnpm/npm or hitting gitea/api endpoints so proxy settings flip to the correct environment.
|
||||
- **Quick check:** use `scripts/run-registry-tests.sh` to install, test, and verify `https://api.bytelyst.com`, `https://gitea.bytelyst.com`, and `https://ollama.bytelyst.com`.
|
||||
|
||||
## Known Limitations
|
||||
|
||||
|
||||
38
scripts/run-registry-tests.sh
Executable file
38
scripts/run-registry-tests.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
readonly BASEDIR="/opt/bytelyst/learning_ai_common_plat"
|
||||
readonly TOKEN_FILE="${GITEA_NPM_TOKEN_FILE:-$HOME/.gitea_npm_token}"
|
||||
|
||||
if [[ -z "${GITEA_NPM_TOKEN:-}" ]]; then
|
||||
if [[ -f "$TOKEN_FILE" ]]; then
|
||||
export GITEA_NPM_TOKEN
|
||||
GITEA_NPM_TOKEN="$(<"$TOKEN_FILE")"
|
||||
else
|
||||
echo "Need GITEA_NPM_TOKEN (file $TOKEN_FILE or env)."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
source "$BASEDIR/scripts/switch-network.sh" >/dev/null
|
||||
export NETWORK="${NETWORK:-home}"
|
||||
|
||||
cd "$BASEDIR"
|
||||
corepack pnpm install
|
||||
corepack pnpm test
|
||||
|
||||
echo "Verifying HTTP responses..."
|
||||
for url in \
|
||||
https://api.bytelyst.com/platform/health \
|
||||
https://gitea.bytelyst.com/api/packages/ByteLyst/npm/ \
|
||||
https://ollama.bytelyst.com/api/version \
|
||||
; do
|
||||
if curl -sSfI "$url" >/tmp/last-curl.out; then
|
||||
status=$(head -n1 /tmp/last-curl.out)
|
||||
echo "$url -> $status"
|
||||
else
|
||||
echo "$url -> failed, see /tmp/last-curl.out"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Done. pnpm install/test + endpoint verification complete."
|
||||
Loading…
Reference in New Issue
Block a user