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