From 6946ebac1a3cd3ee4cc97d57f8a72b6c57b8ddfa Mon Sep 17 00:00:00 2001 From: Christian Medina <37550954+cmedinasoriano@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:15:51 -0400 Subject: [PATCH] feat: use local Gitea when available, fallback to remote --- deploy-and-train.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deploy-and-train.sh b/deploy-and-train.sh index 6a2f23a..69e14b7 100755 --- a/deploy-and-train.sh +++ b/deploy-and-train.sh @@ -21,10 +21,15 @@ DEPLOY_USER="${LORA_DEPLOY_USER:-}" DEPLOY_TOKEN="${LORA_DEPLOY_TOKEN:-}" # Build the repo URL; embed user:token for HTTPS auth when provided. -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}" +# Use local Gitea if available, otherwise fall back to remote +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 - 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 REPO_DIR="${LORA_DEPLOY_REPO_DIR:-/opt/loras/agenx-lora-training}" BRANCH="${LORA_DEPLOY_BRANCH:-main}"