Implements weekly upstream rebase cadence automation: - GitLab CI scheduled pipeline (every 6 hours) - Automatic GitHub release detection - JIRA ticket creation via API - Spec file updates with changelog - Automated MR creation with OSCI Bot integration - TEST_MODE support for safe testing Scripts: - check-upstream-release.sh: Poll GitHub API for new releases - create-release-mr.sh: Main automation orchestrator - update-spec.py: Safe spec file updater - create-jira.sh: JIRA API client - test-workflow.sh: Local testing utility Documentation: - scripts/README.md: Technical documentation - AUTOMATION-SETUP.md: Step-by-step setup guide |
||
|---|---|---|
| .. | ||
| check-upstream-release.sh | ||
| create-jira.sh | ||
| create-release-mr.sh | ||
| README.md | ||
| test-workflow.sh | ||
| update-spec.py | ||
bootc CentOS Stream Release Automation
This directory contains scripts for automating bootc releases to CentOS Stream.
Overview
The automation runs as a GitLab CI scheduled pipeline (every 6 hours) that:
- Checks GitHub for new bootc releases
- Creates a JIRA ticket for tracking
- Downloads tarballs from GitHub
- Updates the spec file and sources
- Creates a GitLab Merge Request
- OSCI Bot handles CI checks and auto-merges if all tests pass
Architecture
┌─────────────────────────────────────────────┐
│ GitLab Scheduled Pipeline (every 6 hours) │
└──────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ check_new_release job │
│ → scripts/check-upstream-release.sh │
│ → Compares GitHub latest vs spec version │
│ → Outputs: release.env │
└──────────────┬──────────────────────────────┘
│ if NEW_RELEASE=true
▼
┌─────────────────────────────────────────────┐
│ create_release_mr job │
│ → scripts/create-release-mr.sh │
│ ├─ Download tarballs from GitHub │
│ ├─ Create JIRA (scripts/create-jira.sh) │
│ ├─ Upload sources via centpkg │
│ ├─ Update spec (scripts/update-spec.py) │
│ ├─ Commit and push branch │
│ └─ Create GitLab MR via API │
└──────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ OSCI Bot Workflow (automatic) │
│ → Runs required checks │
│ → Auto-approves if tests pass │
│ → Auto-merges with Red Hat approval │
└─────────────────────────────────────────────┘
Scripts
check-upstream-release.sh
Polls the GitHub API for the latest bootc release and compares it with the current spec file version.
Usage:
./scripts/check-upstream-release.sh
Output:
Creates release.env with:
NEW_RELEASE(true/false)VERSION(e.g., "1.5.2")RELEASE_TAG(e.g., "v1.5.2")CURRENT_VERSION(current spec version)
create-release-mr.sh
Main automation script that orchestrates the entire release process.
Prerequisites:
release.envmust exist (created by check-upstream-release.sh)- Environment variables configured (see below)
centpkginstalled and configured- Git credentials set up
What it does:
- Downloads tarballs from GitHub releases
- Creates JIRA ticket via API
- Creates working branch (
rebase-X.Y.Z) - Uploads sources to CentOS lookaside cache
- Updates spec file (Version, Release, changelog)
- Commits and pushes changes
- Creates GitLab MR with assignee
Usage:
# Normally run by GitLab CI, but can be run manually:
export VERSION=1.5.2
export RELEASE_TAG=v1.5.2
./scripts/create-release-mr.sh
update-spec.py
Python helper to safely update the spec file.
Usage:
./scripts/update-spec.py <spec_file> <version> <jira_ticket> [author]
Example:
./scripts/update-spec.py bootc.spec 1.5.2 RHEL-104567
What it does:
- Updates
Version:field - Resets
Release:to1%{?dist} - Adds properly formatted changelog entry
- Preserves spec file formatting
create-jira.sh
Creates a JIRA issue for the release via REST API.
Usage:
export JIRA_API_TOKEN="your-token-here"
./scripts/create-jira.sh <version> [upstream_url]
Example:
./scripts/create-jira.sh 1.5.2
# Outputs: RHEL-104567
Returns: JIRA ticket key (e.g., RHEL-104567) on stdout
GitLab CI/CD Variables
Configure these in Settings → CI/CD → Variables:
| Variable | Description | Type |
|---|---|---|
JIRA_API_TOKEN |
JIRA API token for bootc-release-bot | Masked |
GITLAB_API_TOKEN |
GitLab API token (scope: api, write_repository) |
Masked |
CENTOS_SSH_PRIVATE_KEY |
SSH private key for centpkg lookaside uploads | File, Masked |
BOT_EMAIL |
bootc-release-bot@redhat.com | Variable |
ASSIGNEE_USER_ID |
GitLab user ID for MR assignee (e.g., 1234567) |
Variable |
GitLab Schedule Setup
- Go to Settings → CI/CD → Schedules
- Click New schedule
- Configure:
- Description: "Check for new bootc releases"
- Interval: Custom →
0 */6 * * *(every 6 hours) - Target branch:
c10s - Active: ✅ Yes
Manual Testing
Test the release checker
./scripts/check-upstream-release.sh
cat release.env
Test spec file update
./scripts/update-spec.py bootc.spec 1.5.2 RHEL-TEST-001 "Your Name <your@email.com>"
git diff bootc.spec
git restore bootc.spec # Undo changes
Test JIRA creation (requires API token)
export JIRA_API_TOKEN="your-token"
./scripts/create-jira.sh 1.5.2
Trigger pipeline manually
- Go to CI/CD → Pipelines
- Click Run pipeline
- Select branch:
c10s - Add variable:
CI_PIPELINE_SOURCE=web - Click Run pipeline
Troubleshooting
Pipeline fails at check_new_release
- Verify GitHub API is accessible:
curl -s https://api.github.com/repos/containers/bootc/releases/latest | jq .tag_name - Check spec file exists and is parseable:
rpmspec -q --queryformat='%{version}\n' bootc.spec
Pipeline fails at create_release_mr
- JIRA creation fails: Check
JIRA_API_TOKENis valid and bot has permissions- The automation continues with placeholder
RHEL-XXXXXif JIRA fails
- The automation continues with placeholder
- centpkg upload fails: Check
CENTOS_SSH_PRIVATE_KEYis configured correctly - Git push fails: Verify bot has Developer role on the GitLab project
- MR creation fails: Check
GITLAB_API_TOKENhasapiandwrite_repositoryscopes
MR created but not auto-merging
- Check OSCI Bot comments on the MR for test failures
- Ensure another Red Hatter approves the MR (required for auto-merge)
- Review failed tests and fix issues
No new releases detected
- Verify upstream has actually released a new version: https://github.com/containers/bootc/releases
- Check current spec version matches latest upstream:
rpmspec -q --queryformat='%{version}\n' bootc.spec
Bot Account Setup
The automation uses bootc-release-bot account:
GitLab:
- Developer role on
gitlab.com/redhat/centos-stream/rpms/bootc - API token with
apiandwrite_repositoryscopes - SSH key for centpkg uploads
JIRA:
- Account with issue creation permissions in RHEL project
- API token configured in GitLab CI/CD variables
Git config:
git config user.name "bootc-release-bot"
git config user.email "bootc-release-bot@redhat.com"
Weekly Cadence
With the 6-hour scheduled pipeline, new releases are detected within:
- Best case: <6 hours after upstream release
- Average: 3 hours after upstream release
- Worst case: ~6 hours after upstream release
This ensures the weekly cadence is maintained with minimal manual intervention.
Success Metrics
- ✅ Zero missed upstream releases
- ✅ MRs created within 6 hours of upstream release
- ✅ Auto-merge rate >90% (indicates healthy CI)
- ✅ Manual intervention required <10% of releases
Support
For issues or questions:
- Check GitLab pipeline logs for detailed error messages
- Review OSCI Bot comments on MRs for test failures
- Contact the bootc team for bot account or permission issues