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
6.2 KiB
bootc CentOS Stream Automation - Setup Guide
This guide covers the steps needed to activate the automated release process.
✅ What's Been Created
The following automation infrastructure is ready:
.gitlab-ci.yml- GitLab CI pipeline configurationscripts/check-upstream-release.sh- GitHub API pollerscripts/create-release-mr.sh- Main automation orchestratorscripts/update-spec.py- Spec file updaterscripts/create-jira.sh- JIRA API clientscripts/README.md- Complete documentation
🧪 Testing the Workflow
Before setting up production automation, you can test locally:
# Test release detection and spec update (safe, no changes)
./scripts/test-workflow.sh
# Test in GitLab CI with TEST_MODE (stops before git push)
# 1. Push this branch to GitLab
# 2. Go to CI/CD → Pipelines → Run Pipeline
# 3. Add variable: TEST_MODE=true
# 4. Watch the pipeline execute and stop before making changes
Note: This automation is currently configured for c10s only. To enable for c9s:
- Create a separate branch from c9s:
git checkout c9s && git checkout -b c9s-add-release-automation - Merge or cherry-pick these changes
- Update
.gitlab-ci.ymlto setBASE_BRANCH: c9s - Set up a separate scheduled pipeline for c9s
🔧 Required Setup Steps
1. Bot Account Creation
Create bootc-release-bot account (similar to imagebuilder-bot):
GitLab Account:
- Email:
bootc-release-bot@redhat.com - Add as Developer to:
gitlab.com/redhat/centos-stream/rpms/bootc
JIRA Account:
- Same email:
bootc-release-bot@redhat.com - Request permissions to create issues in RHEL project
2. Generate Credentials
GitLab API Token:
- Log in as bootc-release-bot
- Go to User Settings → Access Tokens
- Create token with scopes:
apiwrite_repository
- Save the token securely
GitLab SSH Key (for centpkg):
ssh-keygen -t ed25519 -C "bootc-release-bot@redhat.com" -f ~/.ssh/bootc-bot
# Add public key to GitLab: Settings → SSH Keys
# Save private key for GitLab CI variable
JIRA API Token:
- Log in to https://issues.redhat.com as bootc-release-bot
- Go to Account Settings → Security → API Tokens
- Create new token
- Save the token securely
3. Configure GitLab CI/CD Variables
In the bootc GitLab project, go to Settings → CI/CD → Variables and add:
| Variable Name | Value | Type | Masked | Protected |
|---|---|---|---|---|
JIRA_API_TOKEN |
(JIRA token from step 2) | Variable | ✅ | ❌ |
GITLAB_API_TOKEN |
(GitLab token from step 2) | Variable | ✅ | ❌ |
CENTOS_SSH_PRIVATE_KEY |
(SSH private key from step 2) | File | ✅ | ❌ |
BOT_EMAIL |
bootc-release-bot@redhat.com |
Variable | ❌ | ❌ |
ASSIGNEE_USER_ID |
(Your GitLab user ID) | Variable | ❌ | ❌ |
To find your GitLab user ID:
# Using GitLab API
curl "https://gitlab.com/api/v4/users?username=YOUR_USERNAME" | jq '.[0].id'
# Or check your profile URL: gitlab.com/YOUR_USERNAME
# The numeric ID is shown in the API response
4. Set Up Scheduled Pipeline
- Go to Settings → CI/CD → Schedules
- Click New schedule
- Fill in:
- Description:
Check for new bootc releases - Interval Pattern: Custom
- Cron:
0 */6 * * *(every 6 hours) - Cron timezone: UTC
- Target branch:
c10s - Active: ✅
- Description:
- Save schedule
5. Commit Automation to Repository
git add .gitlab-ci.yml scripts/
git commit -m "Add automated release pipeline
Implements weekly upstream rebase cadence automation:
- Polls GitHub every 6 hours for new releases
- Creates JIRA tickets automatically
- Updates spec file and creates MRs
- Leverages OSCI Bot for auto-merge
Resolves: #RHEL-XXXXX"
git push origin c9s
6. Test the Automation
Dry Run Test:
- Go to CI/CD → Pipelines
- Click Run pipeline
- Select branch:
c10s - Click Run pipeline
- Watch the pipeline execute
- Verify it detects the current version correctly
Live Test (when next release happens):
- Wait for next upstream bootc release
- Within 6 hours, check for automated MR
- Verify MR has:
- Correct version in title and spec
- JIRA ticket created and referenced
- Assignee set for notifications
- Monitor OSCI Bot checks
- Confirm auto-merge if tests pass
📋 Checklist
Before going live, ensure:
bootc-release-botaccount created- Bot added as Developer to GitLab project
- Bot has JIRA issue creation permissions
- GitLab API token generated
- SSH key generated and added
- JIRA API token generated
- All 5 CI/CD variables configured
- Scheduled pipeline created
- Automation code committed to
c9s - Dry run pipeline executed successfully
- Team notified about new automation
🎯 Expected Behavior
Once active:
- Every 6 hours: Pipeline checks for new releases
- When new release found:
- JIRA ticket created automatically
- Tarballs downloaded from GitHub
- Spec file updated with changelog
- MR created and assigned
- OSCI Bot workflow:
- Runs all required tests
- Auto-approves if tests pass
- Auto-merges with Red Hat approval
- If tests fail:
- Assignee gets email notification
- Manual intervention required
🆘 Rollback Plan
If automation causes issues:
-
Disable schedule:
- Go to Settings → CI/CD → Schedules
- Toggle schedule to inactive
-
Revert code:
git revert <commit-hash> git push origin c9s -
Return to manual process (documented in scripts/README.md)
📞 Support Contacts
- GitLab permissions: (Your GitLab admin contact)
- JIRA permissions: (Your JIRA admin contact)
- Bot account setup: (Your IT/identity management contact)
🔍 Monitoring
Track automation health:
- Pipeline success rate: Settings → CI/CD → Pipelines
- MR auto-merge rate: Check recent MRs for OSCI Bot approvals
- Missed releases: Compare GitHub releases vs CentOS Stream versions weekly
Target metrics:
- Pipeline success rate: >95%
- Auto-merge rate: >90%
- Release detection latency: <6 hours
Questions or issues? See scripts/README.md for troubleshooting guide.