Upgrade to Pro — share decks privately, control downloads, hide ads and more …

openSUSE conf. SCM/CI Integration

openSUSE conf. SCM/CI Integration

Rubhan Azeem

May 26, 2023
Tweet

Other Decks in Programming

Transcript

  1. openSUSE Conference 2023
    Rubhan Azeem
    Introduction to OBS GitLab/GitHub CI Integration

    View Slide

  2. 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

    View Slide

  3. 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

    View Slide

  4. 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

    View Slide

  5. GitHub personal access token OBS workflow token

    View Slide

  6. Webhook
    Payload URL:
    https://build.opensuse.org/trigger/workflow
    ?id=12345

    View Slide

  7. 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

    View Slide

  8. 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

    View Slide

  9. Workflow steps
    o
    branch_package
    o
    link_package
    o
    configure_repositories
    o
    rebuild_package
    o
    set_flag
    o
    trigger_service

    View Slide

  10. 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

    View Slide

  11. OBS workflow status

    View Slide

  12. How to debug workflows
    Workflow runs GitHub webhook responses

    View Slide

  13. Limitations
    o
    GitHub, GitLab, Gitea
    o
    Public instances
    o
    Public repositories

    View Slide

  14. 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

    View Slide

  15. Thank you!

    View Slide