diff options
author | Oliver Smith <osmith@sysmocom.de> | 2023-07-26 14:34:42 +0200 |
---|---|---|
committer | osmith <osmith@sysmocom.de> | 2023-07-31 08:22:09 +0000 |
commit | 1dcb49a8110e65351f7e3253b98e7d55141865b0 (patch) | |
tree | 9efcbe220398b85ae96b6c2b84befdc807a7924c /jobs/gerrit-binpkgs.yml | |
parent | bd763747adab4be4d500ff9e109446d9b156301d (diff) |
jobs/gerrit-binpkgs: don't hardcode distros
Make it possible to set a list of distributions to check in
gerrit-verifications.yml instead of only having one boolean for testing
two hardcoded rpm and deb distributions.
Change-Id: I59487e3dc2f55057de1b6a322f088fff0d18654c
Diffstat (limited to 'jobs/gerrit-binpkgs.yml')
-rw-r--r-- | jobs/gerrit-binpkgs.yml | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/jobs/gerrit-binpkgs.yml b/jobs/gerrit-binpkgs.yml index 7a4e9e9..ecfbd52 100644 --- a/jobs/gerrit-binpkgs.yml +++ b/jobs/gerrit-binpkgs.yml @@ -5,13 +5,10 @@ - project: name: gerrit-binpkgs jobs: - - 'gerrit-binpkgs-{type}' - type: - - 'deb' - - 'rpm' + - 'gerrit-binpkgs' -- job-template: - name: 'gerrit-binpkgs-{type}' +- job: + name: 'gerrit-binpkgs' project-type: freestyle node: osmocom-gerrit concurrent: true @@ -21,7 +18,7 @@ days-to-keep: 30 num-to-keep: 1000 description: | - {type} package job of CI for patches sent to + binary packages job (deb/rpm) of CI for patches sent to <a href="https://gerrit.osmocom.org">gerrit</a> </br></br> Related issue: <a href="https://osmocom.org/issues/2385">OS#2385</a> @@ -44,6 +41,9 @@ - string: name: PROJECT_NAME description: project to test, e.g. 'libosmocore' (set by pipeline) + - string: + name: DISTRO + description: distribution to build for, e.g. 'debian:12' (set by pipeline) scm: - git: @@ -62,14 +62,13 @@ builders: - shell: |- - # Skip rpm build if .spec.in file is missing - if [ "{type}" = "rpm" ] && [ -z "$(find code-from-gerrit -name '*.spec.in')" ]; then - set +x - echo - echo "No *.spec.in file found, skipping rpm build." - echo - exit 0 - fi + # Make obvious which distro we build for, for humans and for parsing + # by scripts/jenkins-gerrit/comment_generate.py + set +x + echo + echo "Building binary packages for distro: '$DISTRO'" + echo + set -x # Clone osmo-ci.git rm -rf osmo-ci @@ -80,13 +79,6 @@ osmo-ci git -C osmo-ci log --oneline - # Get distro from type - case "{type}" in - deb) distro="debian:11" ;; - rpm) distro="almalinux:8" ;; - *) echo "unknown package format: '{type}'"; exit 1 ;; - esac - # Move code from gerrit to build_srcpkg.py's git cache cache_dir=osmo-ci/scripts/obs/_cache mkdir -p $cache_dir @@ -106,7 +98,7 @@ # Build binary package ./build_binpkg.py \ - --docker "$distro" \ + --docker "$DISTRO" \ "$PROJECT_NAME" wrappers: - ansicolor: |