mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 06:04:40 +00:00
setup agent runtime requirements (#7)
This commit is contained in:
parent
5d97c33d7e
commit
e75b3f98a6
17 changed files with 424 additions and 28 deletions
27
scripts/integration/wait-stack
Executable file
27
scripts/integration/wait-stack
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../lib/runtime-env.sh"
|
||||
|
||||
wait_for_url() {
|
||||
local url="$1"
|
||||
local label="$2"
|
||||
local max_attempts="${3:-60}"
|
||||
|
||||
for _ in $(seq 1 "$max_attempts"); do
|
||||
if curl -fsS "$url" >/dev/null 2>&1; then
|
||||
echo "$label ready: $url"
|
||||
return 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "$label did not become ready: $url" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_url "http://localhost:${BETTERNAS_CONTROL_PLANE_PORT}/health" "control plane"
|
||||
wait_for_url "http://localhost:${BETTERNAS_NODE_AGENT_PORT}/health" "node agent"
|
||||
wait_for_url "${NEXTCLOUD_BASE_URL}/status.php" "nextcloud"
|
||||
Loading…
Add table
Add a link
Reference in a new issue