From b5d65e6dae31889859e49338a66d6830fe735a36 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 23 Sep 2022 12:57:18 +0200 Subject: [PATCH] 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 --- jobs/master-builds.yml | 2 ++ jobs/osmocom-obs.yml | 8 ++++++++ scripts/obs/lib/git.py | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 7fc306f2..e7b4c619 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -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 diff --git a/jobs/osmocom-obs.yml b/jobs/osmocom-obs.yml index ff2a18a6..0036493b 100644 --- a/jobs/osmocom-obs.yml +++ b/jobs/osmocom-obs.yml @@ -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 Wiki: binary packages diff --git a/scripts/obs/lib/git.py b/scripts/obs/lib/git.py index 8faf5b21..8081a54b 100644 --- a/scripts/obs/lib/git.py +++ b/scripts/obs/lib/git.py @@ -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: