[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 ""
|
echo ""
|
||||||
|
|
||||||
if [ "$DRY_RUN" = "true" ]; then
|
if [ "$DRY_RUN" = "true" ]; then
|
||||||
echo "🔍 DRY-RUN: Would create PR for $repo:$VERSION"
|
echo "🔍 DRY-RUN: Would push to $repo:$VERSION"
|
||||||
echo "[DRY-RUN] $repo:$VERSION - PR would be created" >> ../$SUMMARY_FILE
|
echo "[DRY-RUN] $repo:$VERSION - would be updated" >> ../$SUMMARY_FILE
|
||||||
else
|
else
|
||||||
echo "🚀 Creating PR for $repo:$VERSION"
|
echo "🚀 Pushing to $repo:$VERSION"
|
||||||
git config user.name "elabore_bot"
|
git config user.name "elabore_bot"
|
||||||
git config user.email "gitea.bot@elabore.coop"
|
git config user.email "gitea.bot@elabore.coop"
|
||||||
git checkout -b "${VERSION}-config_deployment"
|
|
||||||
git add .
|
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}" \
|
if git push --quiet origin HEAD:"${VERSION}"; then
|
||||||
-o topic="${VERSION}-config_deployment" \
|
echo "✅ Pushed to $repo:$VERSION"
|
||||||
-o title="Sync config from ${CONFIG_REPO} (version ${VERSION})" \
|
echo "[PUSHED] $repo:$VERSION" >> ../$SUMMARY_FILE
|
||||||
-o force-push; then
|
|
||||||
echo "✅ PR created for $repo:$VERSION"
|
|
||||||
echo "[CREATED] $repo:$VERSION - PR created" >> ../$SUMMARY_FILE
|
|
||||||
pr_created=$((pr_created + 1))
|
pr_created=$((pr_created + 1))
|
||||||
else
|
else
|
||||||
echo "❌ Push failed for $repo:$VERSION"
|
echo "❌ Push failed for $repo:$VERSION"
|
||||||
@@ -210,12 +206,12 @@ jobs:
|
|||||||
echo " DEPLOYMENT SUMMARY"
|
echo " DEPLOYMENT SUMMARY"
|
||||||
echo "============================================"
|
echo "============================================"
|
||||||
if [ "$DRY_RUN" = "true" ]; then
|
if [ "$DRY_RUN" = "true" ]; then
|
||||||
echo "Mode: DRY-RUN (no PRs created)"
|
echo "Mode: DRY-RUN (no changes pushed)"
|
||||||
else
|
else
|
||||||
echo "Mode: LIVE"
|
echo "Mode: LIVE (direct push to branches)"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "PRs created: $pr_created"
|
echo "Branches updated: $pr_created"
|
||||||
echo "Skipped (no changes): $pr_skipped_no_changes"
|
echo "Skipped (no changes): $pr_skipped_no_changes"
|
||||||
echo "Skipped (branch missing): $pr_skipped_no_branch"
|
echo "Skipped (branch missing): $pr_skipped_no_branch"
|
||||||
echo "Errors: $errors"
|
echo "Errors: $errors"
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ The deployment is **manually triggered** via Gitea Actions interface, giving you
|
|||||||
**Features:**
|
**Features:**
|
||||||
- **Version filter**: Deploy to all versions or a specific one (16.0, 18.0)
|
- **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)
|
- **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:**
|
**Process:**
|
||||||
1. Detects available versions (folders in `config/` other than `common/`)
|
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
|
- Attempts to clone the corresponding branch
|
||||||
- Copies `config/common/` then `config/{version}/`
|
- Copies `config/common/` then `config/{version}/`
|
||||||
- In dry-run: shows what would change
|
- 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`)
|
### 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` |
|
| **Version** | Odoo version to deploy | `all`, `16.0`, `18.0` |
|
||||||
| **Repos** | Target repos (empty = all) | `crm-addons, hr-addons` |
|
| **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
|
#### Deployment Examples
|
||||||
|
|
||||||
@@ -115,7 +116,7 @@ Deployment is done via the Gitea Actions interface:
|
|||||||
→ Review the logs to see what would change
|
→ Review the logs to see what would change
|
||||||
|
|
||||||
4. If satisfied, run again WITHOUT dry-run
|
4. If satisfied, run again WITHOUT dry-run
|
||||||
→ PRs are created in target repos
|
→ Changes are pushed directly to target branches
|
||||||
```
|
```
|
||||||
|
|
||||||
### Modifying CI Configuration
|
### Modifying CI Configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user