Fix Odoo 14 Paths and Repo URL
This commit is contained in:
parent
718a5b9c77
commit
9e2df3fd7a
|
|
@ -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."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue