Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m17s
CI/CD Pipeline / Security Scanning (push) Successful in 2m52s
CI/CD Pipeline / Lint and Format (push) Failing after 54s
CI/CD Pipeline / Terraform Validation (push) Has been cancelled
CI/CD Pipeline / Kubernetes Validation (push) Has been cancelled
Deploy ChainID 138 / Deploy ChainID 138 (push) Has been cancelled
Validation / validate-genesis (push) Has been cancelled
Validation / validate-terraform (push) Has been cancelled
Validation / validate-kubernetes (push) Has been cancelled
Validation / validate-smart-contracts (push) Has been cancelled
Validation / validate-security (push) Has been cancelled
Validation / validate-documentation (push) Has been cancelled
Verify Deployment / Verify Deployment (push) Has been cancelled
Use sudo ssh with ProxyJump=none from dev-bis-ali to Proxmox, build once before syncing all nine banking LXCs, and track deploy scripts as executable. Co-authored-by: Cursor <cursoragent@cursor.com>
60 lines
1.7 KiB
Bash
Executable File
60 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Shared SSH/SCP helpers for Proxmox pct deploy from dev-bis-ali (LAN).
|
|
set -euo pipefail
|
|
|
|
OMNL_PVE_HOST="${OMNL_PVE_HOST:-192.168.11.13}"
|
|
OMNL_PVE_USER="${OMNL_PVE_USER:-root}"
|
|
OMNL_PVE_SSH_HOST="${OMNL_PVE_SSH_HOST:-${OMNL_PVE_HOST}}"
|
|
OMNL_PVE_SSH_TARGET="${OMNL_PVE_USER}@${OMNL_PVE_SSH_HOST}"
|
|
|
|
# Avoid cloudflared ProxyJump when using raw 192.168.11.x from dev-bis-ali.
|
|
OMNL_PVE_SSH_BASE_OPTS=(
|
|
-o BatchMode=yes
|
|
-o ConnectTimeout=20
|
|
-o StrictHostKeyChecking=accept-new
|
|
-o ProxyJump=none
|
|
)
|
|
|
|
OMNL_PVE_SSH_PREFIX=()
|
|
|
|
omnl_pve_detect_sudo() {
|
|
if [[ -n "${OMNL_PVE_SSH_PREFIX[*]:-}" ]]; then
|
|
return 0
|
|
fi
|
|
if [[ "${OMNL_PVE_USE_SUDO:-auto}" == "0" ]]; then
|
|
OMNL_PVE_SSH_PREFIX=()
|
|
return 0
|
|
fi
|
|
if [[ "${OMNL_PVE_USE_SUDO:-auto}" == "1" ]]; then
|
|
OMNL_PVE_SSH_PREFIX=(sudo)
|
|
return 0
|
|
fi
|
|
if ssh "${OMNL_PVE_SSH_BASE_OPTS[@]}" "$OMNL_PVE_SSH_TARGET" true 2>/dev/null; then
|
|
OMNL_PVE_SSH_PREFIX=()
|
|
elif sudo -n ssh "${OMNL_PVE_SSH_BASE_OPTS[@]}" "$OMNL_PVE_SSH_TARGET" true 2>/dev/null; then
|
|
OMNL_PVE_SSH_PREFIX=(sudo)
|
|
else
|
|
echo "Cannot SSH to ${OMNL_PVE_SSH_TARGET} (tried direct and sudo)." >&2
|
|
echo "Fix: bash scripts/deployment/setup-dev1-pve-ssh-access.sh" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
omnl_pve_ssh() {
|
|
omnl_pve_detect_sudo
|
|
"${OMNL_PVE_SSH_PREFIX[@]}" ssh "${OMNL_PVE_SSH_BASE_OPTS[@]}" "$OMNL_PVE_SSH_TARGET" "$@"
|
|
}
|
|
|
|
omnl_pve_scp() {
|
|
omnl_pve_detect_sudo
|
|
"${OMNL_PVE_SSH_PREFIX[@]}" scp "${OMNL_PVE_SSH_BASE_OPTS[@]}" "$@"
|
|
}
|
|
|
|
omnl_pve_preflight() {
|
|
omnl_pve_detect_sudo
|
|
omnl_pve_ssh "command -v pct >/dev/null && pct list >/dev/null" || {
|
|
echo "Proxmox pct unavailable on ${OMNL_PVE_SSH_TARGET}" >&2
|
|
return 1
|
|
}
|
|
}
|