openSUSE Conference 2023
Rubhan Azeem
Introduction to OBS GitLab/GitHub CI Integration
Slide 2
Slide 2 text
This talk is focused on
o
Introduction to the SCM/CI integration
o
Example of a workflow implementation
o
Limitations of SCM/CI integration
Overview of the talk
Slide 3
Slide 3 text
o
SCM collaborate, OBS build
o
Manage your packages sources
o
Integration with OBS
o
Run different workflows e.g., package building and
update status to the SCM
o
Take advantage of SCM systems
Introduction
Slide 4
Slide 4 text
Requirements
o
Repository on GitHub
o
Package on OBS
o
Workflows definition should reside in .obs/workflows.yml
o
Personal access token on SCM (With minimum scope of repo in case of
GitHub)
o
Workflow token on OBS
o
Set a Webhook
Implementation of a workflow
o
OBS and GitHub talk to each other via tokens
o
GitHub tells OBS about certain event (a new pull/merge request was opened) via webhooks
o
You configure the workflow that should run on OBS in a YAML file stored in your GitHub
repository
o
OBS executes the workflow you configured
o
OBS reports the status (pending, success or failure) of the workflow to the pull request
that was opened
Process behind the scene
Slide 8
Slide 8 text
o
source_project: The name of the project that contains the package
o
source_package: The name of the package you want to build
o
target_project: The name of the project that will contain the branched
package.
Workflows.yml
workflow:
steps:
- branch_package:
source_project: games
source_package: ctris
target_project: home:jane
Slide 9
Slide 9 text
Workflow steps
o
branch_package
o
link_package
o
configure_repositories
o
rebuild_package
o
set_flag
o
trigger_service
Slide 10
Slide 10 text
Filters
o
Customize workflows by declaring
branch or event
filters:
event: pull_request
branches:
only:
- master
- staging
filters:
event: pull_request
branches:
ignore:
- staging
filters:
event: pull_request
Slide 11
Slide 11 text
OBS workflow status
Slide 12
Slide 12 text
How to debug workflows
Workflow runs GitHub webhook responses
Slide 13
Slide 13 text
Limitations
o
GitHub, GitLab, Gitea
o
Public instances
o
Public repositories
Slide 14
Slide 14 text
1. User documentation SCM/CI
integration https://openbuildservice.org/help/manuals/obs-user-
guide/cha.obs.scm_ci_workflow_integration.html
2. Blog posts for latest
updates https://openbuildservice.org/2021/05/31/scm-integration/
3. GitHub repo: https://github.com/rubhanazeem/hello_world/
4. Contact: [email protected]
References