feat: add remote control plane and whitelist reads
Build web service image / build (push) Successful in 1m53s
Build web service image / build (push) Successful in 1m53s
This commit is contained in:
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
port=${WXAGENT_SMOKE_PORT:-18090}
|
||||
data_file=$(mktemp)
|
||||
log_file=$(mktemp)
|
||||
binary="${data_file}.control-plane"
|
||||
cleanup() {
|
||||
if [[ -n "${control_pid:-}" ]]; then
|
||||
kill "$control_pid" 2>/dev/null || true
|
||||
wait "$control_pid" 2>/dev/null || true
|
||||
fi
|
||||
rm -f "$data_file" "$log_file" "$binary"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
(
|
||||
cd "$root/control-plane"
|
||||
npm --prefix web ci --no-audit --no-fund >/dev/null
|
||||
npm --prefix web run build >/dev/null
|
||||
go build -o "$binary" ./cmd/wxagent-control-plane
|
||||
WXAGENT_CONTROL_PLANE_ADDR="127.0.0.1:${port}" \
|
||||
WXAGENT_CONTROL_PLANE_DATA="$data_file" \
|
||||
WXAGENT_NODE_ID="smoke-node" \
|
||||
WXAGENT_NODE_TOKEN="smoke-node-token" \
|
||||
WXAGENT_WEB_USER="admin" \
|
||||
WXAGENT_WEB_PASSWORD="smoke-web-password" \
|
||||
"$binary"
|
||||
) >"$log_file" 2>&1 &
|
||||
control_pid=$!
|
||||
|
||||
for _ in $(seq 1 60); do
|
||||
if curl -fsS "http://127.0.0.1:${port}/healthz" >/dev/null 2>&1; then break; fi
|
||||
sleep 0.1
|
||||
done
|
||||
curl -fsS "http://127.0.0.1:${port}/healthz" >/dev/null
|
||||
|
||||
dotnet run --project "$root/tests/node-agent/WxAgent.Remote.Integration/WxAgent.Remote.Integration.csproj" --no-restore -- \
|
||||
--base-url "http://127.0.0.1:${port}" \
|
||||
--node-id smoke-node \
|
||||
--node-token smoke-node-token \
|
||||
--web-user admin \
|
||||
--web-password smoke-web-password
|
||||
Reference in New Issue
Block a user