feat: use local Gitea when available, fallback to remote
This commit is contained in:
@@ -21,10 +21,15 @@ DEPLOY_USER="${LORA_DEPLOY_USER:-}"
|
|||||||
DEPLOY_TOKEN="${LORA_DEPLOY_TOKEN:-}"
|
DEPLOY_TOKEN="${LORA_DEPLOY_TOKEN:-}"
|
||||||
|
|
||||||
# Build the repo URL; embed user:token for HTTPS auth when provided.
|
# Build the repo URL; embed user:token for HTTPS auth when provided.
|
||||||
if [ -n "${DEPLOY_USER}" ] && [ -n "${DEPLOY_TOKEN}" ]; then
|
# Use local Gitea if available, otherwise fall back to remote
|
||||||
REPO_URL="${LORA_DEPLOY_REPO_URL:-https://${DEPLOY_USER}:${DEPLOY_TOKEN}@gitea.cyaren.com/cmedina/agenx-lora-training.git}"
|
if ping -c 1 -W 1 192.168.50.232 &>/dev/null; then
|
||||||
|
REPO_URL="${LORA_DEPLOY_REPO_URL:-http://192.168.50.232:8091/cmedina/agenx-lora-training.git}"
|
||||||
else
|
else
|
||||||
REPO_URL="${LORA_DEPLOY_REPO_URL:-https://gitea.cyaren.com/cmedina/agenx-lora-training.git}"
|
if [ -n "${DEPLOY_USER}" ] && [ -n "${DEPLOY_TOKEN}" ]; then
|
||||||
|
REPO_URL="${LORA_DEPLOY_REPO_URL:-https://${DEPLOY_USER}:${DEPLOY_TOKEN}@gitea.cyaren.com/cmedina/agenx-lora-training.git}"
|
||||||
|
else
|
||||||
|
REPO_URL="${LORA_DEPLOY_REPO_URL:-https://gitea.cyaren.com/cmedina/agenx-lora-training.git}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
REPO_DIR="${LORA_DEPLOY_REPO_DIR:-/opt/loras/agenx-lora-training}"
|
REPO_DIR="${LORA_DEPLOY_REPO_DIR:-/opt/loras/agenx-lora-training}"
|
||||||
BRANCH="${LORA_DEPLOY_BRANCH:-main}"
|
BRANCH="${LORA_DEPLOY_BRANCH:-main}"
|
||||||
|
|||||||
Reference in New Issue
Block a user