Skip to content

openSUSE/scm-staging

Repository files navigation

SCM Staging

This project contains helper libraries & tools to automatically create submit requests and eventually a full staging workflow from pull requests in gitea.

Requirements

for development:

for deployment:

  • A machine with a public IP
  • A container runtime of your choice

Setup

  1. Clone this repository
git clone https://github.com/dcermak/scm-staging
  1. Build the container:
buildah bud --layers -t webhook -f Dockerfile.webhook .
  1. Create the json configuration file. It contains a single list of objects, where each object configures the behavior of the bot for one organization on gitea. Each of these objects has the following contents (the keys require_approval, submission_style, merge_pr and project_prefix are optional), the keys are defined in the class :py~scm_staging.config.BranchConfig:
{
  "target_branch_name": "factory",
  "organization": "rpm",
  "destination_project": "openSUSE:Factory",
  "merge_pr": false,
  "submission_style": "factory_devel",
  "require_approval": true,
  "project_prefix": "devel:scm"
}
  1. Launch the container:
podman run -d -e "GITEA_API_KEY=$YOUR_API_KEY"      \
              -e "OSC_USER=$YOUR_OBS_ACCOUNT"       \
              -e "OSC_PASSWORD=$YOUR_OBS_PASSWORD"  \
              -p 8000:8000                          \
              --name webhook                        \
              -v /path/to/config/scm_staging:/src:z \
              localhost/webhook:latest
  1. Go to your dist-git repository on https://src.opensuse.org and add a webhook with the url $YOUR_HOST_IP/hook:8000. Or add it for a whole organization or the full gitea instance.

About

Library & tools for staging pull requests from gitea in the Open Build Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages