From 111a608c5f25c173d0a1392161103fbacd1e1698 Mon Sep 17 00:00:00 2001 From: maltayyar2 Date: Sun, 25 Jan 2026 16:48:55 +0300 Subject: [PATCH] Fix Odoo 14 Paths and Repo URL --- .github/workflows/deploy-manager.yml | 48 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy-manager.yml b/.github/workflows/deploy-manager.yml index a0b8343f3..cb4d1f532 100644 --- a/.github/workflows/deploy-manager.yml +++ b/.github/workflows/deploy-manager.yml @@ -129,20 +129,36 @@ jobs: TARGET_DIR="$TARGET_ROOT/$MODULE" - if [ -d "$TARGET_DIR" ]; then - cd "$TARGET_DIR" - echo "⬇️ Pulling changes from $BRANCH..." - git fetch origin - git reset --hard origin/$BRANCH - - if [ "$FORCE_RESTART" == "true" ] || [ "${{ github.event_name }}" == "push" ]; then - echo "🔄 Restarting Service..." - cd /root/odoo-infra - docker compose restart $SERVICE - fi - - echo "✅ Deployment Successful." - else - echo "⚠️ Module directory not found: $TARGET_DIR" - exit 1 + # Ensure directory exists + if [ ! -d "$TARGET_DIR" ]; then + echo "✨ Creating new module directory: $TARGET_DIR" + mkdir -p "$TARGET_DIR" fi + + cd "$TARGET_DIR" + + # Robust Git Initialization + if [ ! -d ".git" ]; then + echo "Initializing new git repo..." + git init + git remote add origin git@github.com:hydracp9/odex25_standard.git + else + # Ensure remote is correct + current_url=$(git remote get-url origin || echo "") + if [ "$current_url" != "git@github.com:hydracp9/odex25_standard.git" ]; then + echo "Updating remote URL..." + git remote set-url origin git@github.com:hydracp9/odex25_standard.git + fi + fi + + echo "⬇️ Pulling changes from $BRANCH..." + git fetch origin $BRANCH + git reset --hard FETCH_HEAD + + if [ "$FORCE_RESTART" == "true" ] || [ "${{ github.event_name }}" == "push" ]; then + echo "🔄 Restarting Service..." + cd /root/odoo-infra + docker compose restart $SERVICE + fi + + echo "✅ Deployment Successful."