Fix Odoo 14 Paths and Repo URL

This commit is contained in:
maltayyar2 2026-01-25 16:47:55 +03:00
parent 49027e2ccc
commit 3f46e8b008
1 changed files with 32 additions and 16 deletions

View File

@ -129,20 +129,36 @@ jobs:
TARGET_DIR="$TARGET_ROOT/$MODULE" TARGET_DIR="$TARGET_ROOT/$MODULE"
if [ -d "$TARGET_DIR" ]; then # Ensure directory exists
cd "$TARGET_DIR" if [ ! -d "$TARGET_DIR" ]; then
echo "⬇️ Pulling changes from $BRANCH..." echo "✨ Creating new module directory: $TARGET_DIR"
git fetch origin mkdir -p "$TARGET_DIR"
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
fi 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."