[IMP] push directly to branches instead of creating PRs
CI config changes are low-risk and don't affect business code. Direct push eliminates the need to manually validate 50+ PRs. Changes: - Push commits directly to target branches (no AGit PR flow) - Simplified commit message: '[CI] sync config from odoo-elabore-ci' - Update README to reflect direct push behavior
This commit is contained in:
@@ -173,22 +173,18 @@ jobs:
|
||||
echo ""
|
||||
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
echo "🔍 DRY-RUN: Would create PR for $repo:$VERSION"
|
||||
echo "[DRY-RUN] $repo:$VERSION - PR would be created" >> ../$SUMMARY_FILE
|
||||
echo "🔍 DRY-RUN: Would push to $repo:$VERSION"
|
||||
echo "[DRY-RUN] $repo:$VERSION - would be updated" >> ../$SUMMARY_FILE
|
||||
else
|
||||
echo "🚀 Creating PR for $repo:$VERSION"
|
||||
echo "🚀 Pushing to $repo:$VERSION"
|
||||
git config user.name "elabore_bot"
|
||||
git config user.email "gitea.bot@elabore.coop"
|
||||
git checkout -b "${VERSION}-config_deployment"
|
||||
git add .
|
||||
git commit -m "Sync config from ${CONFIG_REPO} (version ${VERSION})"
|
||||
git commit -m "[CI] sync config from ${CONFIG_REPO}"
|
||||
|
||||
if git push --quiet origin "${VERSION}-config_deployment":refs/for/"${VERSION}" \
|
||||
-o topic="${VERSION}-config_deployment" \
|
||||
-o title="Sync config from ${CONFIG_REPO} (version ${VERSION})" \
|
||||
-o force-push; then
|
||||
echo "✅ PR created for $repo:$VERSION"
|
||||
echo "[CREATED] $repo:$VERSION - PR created" >> ../$SUMMARY_FILE
|
||||
if git push --quiet origin HEAD:"${VERSION}"; then
|
||||
echo "✅ Pushed to $repo:$VERSION"
|
||||
echo "[PUSHED] $repo:$VERSION" >> ../$SUMMARY_FILE
|
||||
pr_created=$((pr_created + 1))
|
||||
else
|
||||
echo "❌ Push failed for $repo:$VERSION"
|
||||
@@ -210,12 +206,12 @@ jobs:
|
||||
echo " DEPLOYMENT SUMMARY"
|
||||
echo "============================================"
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
echo "Mode: DRY-RUN (no PRs created)"
|
||||
echo "Mode: DRY-RUN (no changes pushed)"
|
||||
else
|
||||
echo "Mode: LIVE"
|
||||
echo "Mode: LIVE (direct push to branches)"
|
||||
fi
|
||||
echo ""
|
||||
echo "PRs created: $pr_created"
|
||||
echo "Branches updated: $pr_created"
|
||||
echo "Skipped (no changes): $pr_skipped_no_changes"
|
||||
echo "Skipped (branch missing): $pr_skipped_no_branch"
|
||||
echo "Errors: $errors"
|
||||
|
||||
@@ -48,7 +48,8 @@ The deployment is **manually triggered** via Gitea Actions interface, giving you
|
||||
**Features:**
|
||||
- **Version filter**: Deploy to all versions or a specific one (16.0, 18.0)
|
||||
- **Repo filter**: Deploy to all repos or specific ones (comma-separated)
|
||||
- **Dry-run mode**: Preview changes without creating any PRs
|
||||
- **Dry-run mode**: Preview changes without pushing anything
|
||||
- **Direct push**: Commits are pushed directly to target branches (no PR)
|
||||
|
||||
**Process:**
|
||||
1. Detects available versions (folders in `config/` other than `common/`)
|
||||
@@ -57,7 +58,7 @@ The deployment is **manually triggered** via Gitea Actions interface, giving you
|
||||
- Attempts to clone the corresponding branch
|
||||
- Copies `config/common/` then `config/{version}/`
|
||||
- In dry-run: shows what would change
|
||||
- In live mode: creates a Pull Request if changes detected
|
||||
- In live mode: commits and pushes directly to the branch
|
||||
|
||||
### CI Workflow (`pre-commit.yml`)
|
||||
|
||||
@@ -93,7 +94,7 @@ Deployment is done via the Gitea Actions interface:
|
||||
|-----------|-------------|----------|
|
||||
| **Version** | Odoo version to deploy | `all`, `16.0`, `18.0` |
|
||||
| **Repos** | Target repos (empty = all) | `crm-addons, hr-addons` |
|
||||
| **Dry-run** | Preview without creating PRs | `true` (recommended first) |
|
||||
| **Dry-run** | Preview without pushing | `true` (recommended first) |
|
||||
|
||||
#### Deployment Examples
|
||||
|
||||
@@ -115,7 +116,7 @@ Deployment is done via the Gitea Actions interface:
|
||||
→ Review the logs to see what would change
|
||||
|
||||
4. If satisfied, run again WITHOUT dry-run
|
||||
→ PRs are created in target repos
|
||||
→ Changes are pushed directly to target branches
|
||||
```
|
||||
|
||||
### Modifying CI Configuration
|
||||
|
||||
Reference in New Issue
Block a user