osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29595 )
Change subject: jobs/osmocom-obs: add job for master feed ......................................................................
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.osmo... Related: https://obs.osmocom.org/project/show/osmocom:master Related: OS#2385 Change-Id: I53a494f13f81ae837f2d362c54e1bdf13f121db3 --- M jobs/master-builds.yml M jobs/osmocom-obs.yml M scripts/obs/lib/git.py 3 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/95/29595/1
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 7fc306f..e7b4c61 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 ff2a18a..0036493 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 <a href="https://osmocom.org/projects/cellular-infrastructure/wiki/Binary_Packages">Wiki: binary packages</a> diff --git a/scripts/obs/lib/git.py b/scripts/obs/lib/git.py index 8faf5b2..8081a54 100644 --- a/scripts/obs/lib/git.py +++ b/scripts/obs/lib/git.py @@ -88,7 +88,7 @@ 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: