jobs/osmocom-obs: add job for master feed

Add one new job for building source packages and sending them to
obs.osmocom.org. Trigger it from all master-* jobs.

I've also considered adding one job per existing master job that would
only update one package at a time (master-libosmocore-obs,
master-osmo-bsc-obs, ...). With some additional development effort it
should be possible, and it would make each individual master OBS job
faster. But given that with the current implementation it only takes
20s to 30s for *all* packages if there are no changes, as it compares
git remote HEAD with the version currently on OBS before starting to
clone repositories and building the source packages (similar to
Osmocom_OBS_latest_obs.osmocom.org), it didn't seem worth optimizing.

Set concurrent to false as the triggers from master-builds will likely
cause it to run multiple times in parallel otherwise.

Related: https://jenkins.osmocom.org/jenkins/view/OBS/job/Osmocom_OBS_master_obs.osmocom.org/
Related: https://obs.osmocom.org/project/show/osmocom:master
Related: OS#2385
Change-Id: I53a494f13f81ae837f2d362c54e1bdf13f121db3
This commit is contained in:
Oliver Smith 2022-09-23 12:57:18 +02:00 committed by osmith
parent 3a6250a9fb
commit b5d65e6dae
3 changed files with 11 additions and 1 deletions

View File

@ -491,6 +491,8 @@
resolve-relative-paths: true
- trigger:
project: '{obj:trigger}'
- trigger:
project: 'Osmocom_OBS_master_obs.osmocom.org'
- email:
recipients: '{obj:email}'
send-to-individuals: true

View File

@ -4,6 +4,8 @@
jobs:
- Osmocom_OBS_{type}_{server}
type:
- master:
conflict_version: ""
- nightly:
# For nightly we don't provide ABI compatibility, make sure packages
# from different build dates are not mixed by accident
@ -15,10 +17,16 @@
proj: "network:osmocom"
- obs.osmocom.org:
proj: "osmocom"
# Pushing to build.opensuse.org is legacy, will be disabled soon (OS#5557).
# Don't push the new master repository there.
exclude:
- type: master
server: build.opensuse.org
- job-template:
name: 'Osmocom_OBS_{type}_{server}'
project-type: freestyle
concurrent: false
defaults: global
description: |
See <a href="https://osmocom.org/projects/cellular-infrastructure/wiki/Binary_Packages">Wiki: binary packages</a>

View File

@ -88,7 +88,7 @@ def get_head_remote(project, branch):
repo_url = get_repo_url(project)
print(f"{project}: getting head from git remote for {branch}")
ls_remote = lib.run_cmd(["git", "ls-remote", repo_url, branch])
ls_remote = lib.run_cmd(["git", "ls-remote", repo_url, f"heads/{branch}"])
ret = ls_remote.output.split("\t")[0]
if not ret: