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
43
scripts/agent-bootstrap
Executable file
43
scripts/agent-bootstrap
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
env_file="$repo_root/.env.agent"
|
||||
example_env_file="$repo_root/.env.agent.example"
|
||||
|
||||
if [[ ! -f "$env_file" ]]; then
|
||||
cp "$example_env_file" "$env_file"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source "$repo_root/scripts/lib/runtime-env.sh"
|
||||
|
||||
mkdir -p "$BETTERNAS_EXPORT_PATH"
|
||||
|
||||
if [[ ! -f "$BETTERNAS_EXPORT_PATH/README.txt" ]]; then
|
||||
cat >"$BETTERNAS_EXPORT_PATH/README.txt" <<EOF
|
||||
betterNAS export
|
||||
clone=${BETTERNAS_CLONE_NAME}
|
||||
mount_url=${BETTERNAS_EXAMPLE_MOUNT_URL}
|
||||
EOF
|
||||
fi
|
||||
|
||||
pnpm install --frozen-lockfile
|
||||
go work sync
|
||||
|
||||
cat <<EOF
|
||||
Agent bootstrap complete for ${BETTERNAS_CLONE_NAME}
|
||||
|
||||
Env file: ${env_file}
|
||||
Control plane: http://localhost:${BETTERNAS_CONTROL_PLANE_PORT}
|
||||
Node agent: http://localhost:${BETTERNAS_NODE_AGENT_PORT}
|
||||
Nextcloud: ${NEXTCLOUD_BASE_URL}
|
||||
Export path: ${BETTERNAS_EXPORT_PATH}
|
||||
Mount URL: ${BETTERNAS_EXAMPLE_MOUNT_URL}
|
||||
|
||||
Next:
|
||||
pnpm verify
|
||||
pnpm stack:up
|
||||
pnpm stack:verify
|
||||
EOF
|
||||
Loading…
Add table
Add a link
Reference in a new issue