diff options
Diffstat (limited to 'jobs/gerrit-verifications.yml')
-rw-r--r-- | jobs/gerrit-verifications.yml | 603 |
1 files changed, 480 insertions, 123 deletions
diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 85c78b4..0e05918 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -1,14 +1,39 @@ # This file holds all gerrit build verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/. -# One cane simply add a gerrit job by adding project's repository to repos list. +# One can simply add a gerrit job by adding project's repository to repos list. +# +# Overview of jobs involved in the pipeline: +# https://osmocom.org/projects/osmocom-servers/wiki/Jenkins_gerrit-verifications_Pipeline +# +# How it works: +# * Two jobs get added for each repository: +# gerrit-{repos} +# gerrit-{repos}-build +# * The gerrit-{repos} job is a pipeline that runs the gerrit-{repos}-build job +# and other jobs (linting, building debian packages, ...). The purpose of +# this job is to reduce the amount of comments (and resulting mails) in +# gerrit coming from the jenkins build verification. If each job ran +# separately without this pipeline job, they would each generate mails. +# The gerrit-{repos} job gets triggered from gerrit whenever a new patch to +# test is available. It passes the GERRIT_BRANCH and GERRIT_REFSPEC variables +# from gerrit to the jobs called in the pipeline. +# * The gerrit-{repos}-build job runs contrib/jenkins.sh in docker in a matrix. +# By default the matrix results in only one job, however for some projects we +# use the matrix to build for multiple CPU architectures (x86_64, arm) or use +# it to build multiple configurations of the same project (see osmo-bts). +# +# NOTE: after updating the job with Jenkins Job Builder as usual, check if a +# new pipeline script was generated and approve it here: +# https://jenkins.osmocom.org/jenkins/scriptApproval/ +# This used to be necessary when changing the pipeline script, adding new +# projects etc. But it seems to get auto-approved now. - project: name: gerrit # following default values can be overridden by each repo disabled: false concurrent: true - node: osmocom-gerrit-debian9 # axes related defaults - slave_axis: !!python/tuple [osmocom-gerrit-debian9] + slave_axis: !!python/tuple [osmocom-gerrit] a1_name: a1 a1: !!python/tuple [default] a2_name: a2 @@ -24,11 +49,8 @@ # Documentation for variables (keep in sync!): # https://osmocom.org/projects/osmocom-servers/wiki/Jenkins_build_verification_jobs docker_run: | - ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" - mkdir -p "$ARTIFACT_STORE" docker run --rm=true \ --cap-add SYS_PTRACE \ - -e ARTIFACT_STORE=/artifact_store \ -e ASCIIDOC_WARNINGS_CHECK="1" \ -e HOME=/build \ -e JOB_NAME="$JOB_NAME" \ @@ -39,50 +61,74 @@ -e WITH_MANUALS="1" \ -w /build -i -u build \ -v "$PWD:/build" \ - -v "$ARTIFACT_STORE:/artifact_store" \ - docker_img: '$USER/debian-buster-jenkins' - docker_img_erlang: '$USER/debian-bullseye-erlang' + docker_run_ccache: | + CCACHE_DIR="$HOME/ccache/gerrit-verifications" + mkdir -p "$CCACHE_DIR" + chown osmocom-build:osmocom-build "$CCACHE_DIR" + + docker run --rm=true \ + --cap-add SYS_PTRACE \ + -e ASCIIDOC_WARNINGS_CHECK="1" \ + -e HOME=/build \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -e OSMO_GSM_MANUALS_DIR="/opt/osmo-gsm-manuals" \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e WITH_MANUALS="1" \ + -w /build -i -u build \ + -v "$PWD:/build" \ + \ + -e CCACHE_DIR="/ccache" \ + -e PATH="/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + -v "$CCACHE_DIR:/ccache" \ + docker_img: '$USER/debian-bookworm-build' + docker_img_erlang: '$USER/debian-bookworm-erlang' timeout_cmd: '/usr/bin/timeout 30m' - cmd: '{docker_run} {docker_img} {timeout_cmd} /build/contrib/jenkins.sh' + cmd: '{docker_run_ccache} {docker_img} {timeout_cmd} /build/contrib/jenkins.sh' gerrit_url: 'ssh://jenkins@gerrit.osmocom.org:29418' repos_url: '{gerrit_url}/{repos}' gerrit_project: '{repos}' + # Which jobs to run in the pipeline + pipeline_build: true + pipeline_lint: true + pipeline_binpkgs: "debian:10 debian:12" # in alphabetical order repos: - - asn1c - - cellmgr-ng + - asn1c: + pipeline_binpkgs: "" + pipeline_lint: false + + - cellmgr-ng: + pipeline_binpkgs: "debian:10 debian:12" + + - docker-playground: + pipeline_build: false + pipeline_binpkgs: "" + - libasn1c - libgtpnl - libosmo-abis - libosmo-gprs - libosmo-netif - libosmo-pfcp - - libosmo-sccp + - libosmo-sigtran - libosmocore: + slave_axis: !!python/tuple [io_uring] # OS#6405 a1_name: arch a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' - cmd: '{docker_run} {docker_img} {timeout_cmd} /build/contrib/jenkins_arch.sh "$arch"' + cmd: '{docker_run_ccache} {docker_img} {timeout_cmd} /build/contrib/jenkins_arch.sh "$arch"' + pipeline_binpkgs: "centos:7 debian:10 debian:12" # centos7: SYS#6760 - libsmpp34 - - libtelnet - - libusrp - - openbsc: - a1_name: SMPP - a1: !!python/tuple [--enable-smpp] - a2_name: MGCP - a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] - a3_name: IU - a3: !!python/tuple [--disable-iu] - cmd: | - {docker_run} \ - -e IU="$IU" \ - -e SMPP="$SMPP" \ - -e MGCP="$MGCP" \ - {docker_img} {timeout_cmd} /build/contrib/jenkins.sh + - libtelnet: + pipeline_binpkgs: "" + + - libusrp - openggsn: a1_name: GTP @@ -94,7 +140,7 @@ - osmo-bsc-nat - osmo-bts: - slave_axis: !!python/tuple [osmocom-master-debian9, rpi4-raspbian11] + slave_axis: !!python/tuple [osmocom-gerrit, raspbian] a1_name: FIRMWARE_VERSION a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, litecell15, oc2g, oc2g-next] a2_name: BTS_MODEL @@ -102,32 +148,79 @@ a3_name: WITH_MANUALS a3: !!python/tuple ["1", "0"] combination_filter: > - (FIRMWARE_VERSION == "master" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "master" && BTS_MODEL == "trx" && WITH_MANUALS == "0" && label == "rpi4-raspbian11") || - (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo" && WITH_MANUALS == "1" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "litecell15" && BTS_MODEL == "lc15" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "oc2g" && BTS_MODEL == "oc2g" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (FIRMWARE_VERSION == "oc2g-next" && BTS_MODEL == "oc2g" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") + (FIRMWARE_VERSION == "master" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "master" && BTS_MODEL == "trx" && WITH_MANUALS == "0" && label == "raspbian") || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo" && WITH_MANUALS == "1" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "litecell15" && BTS_MODEL == "lc15" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "oc2g" && BTS_MODEL == "oc2g" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (FIRMWARE_VERSION == "oc2g-next" && BTS_MODEL == "oc2g" && WITH_MANUALS == "0" && label == "osmocom-gerrit") concurrent: false cmd: | - {docker_run} \ + DOCKER_IMG="{docker_img}" + case "$(arch)" in + arm*|aarch64) + DOCKER_IMG="$DOCKER_IMG-arm" + SETARCH_CMD="setarch linux32" + ;; + esac + {docker_run_ccache} \ -e FIRMWARE_VERSION="$FIRMWARE_VERSION" \ -e WITH_MANUALS="$WITH_MANUALS" \ - {docker_img} {timeout_cmd} /build/contrib/jenkins_bts_model.sh "$BTS_MODEL" + "$DOCKER_IMG" {timeout_cmd} $SETARCH_CMD /build/contrib/jenkins_bts_model.sh "$BTS_MODEL" - osmo_dia2gsup: repos_url: '{gerrit_url}/erlang/{repos}' gerrit_project: 'erlang/{repos}' cmd: '{docker_run} {docker_img_erlang} {timeout_cmd} /build/contrib/jenkins.sh' + pipeline_binpkgs: "debian:11 debian:12" + + - osmo-epdg: + repos_url: '{gerrit_url}/erlang/{repos}' + gerrit_project: 'erlang/{repos}' + pipeline_binpkgs: "debian:12" + a2_name: JOB_TYPE + a2: !!python/tuple ["build", "manuals"] + cmd: | + case "$JOB_TYPE" in + build) + {docker_run} {docker_img_erlang} {timeout_cmd} /build/contrib/jenkins.sh + ;; + manuals) + {docker_run} {docker_img} {timeout_cmd} /build/contrib/jenkins_manuals.sh + ;; + esac + + - osmo-s1gw: + repos_url: '{gerrit_url}/erlang/{repos}' + gerrit_project: 'erlang/{repos}' + pipeline_binpkgs: "debian:12" + cmd: '{docker_run} {docker_img_erlang} {timeout_cmd} /build/contrib/jenkins.sh' - osmo-e1-hardware: - docker_img: 'registry.osmocom.org/$USER/fpga-build' - cmd: 'docker pull {docker_img} && {docker_run} {docker_img} {timeout_cmd} /build/contrib/jenkins.sh' + a2_name: JOB_TYPE + a2: !!python/tuple ["firmware", "gateware", "manuals", "software"] + cmd: | + DOCKER_IMG="{docker_img}" + case "$JOB_TYPE" in + firmware|gateware|manuals) + DOCKER_IMG="registry.osmocom.org/$USER/fpga-build" + docker pull "$DOCKER_IMG" + ;; + esac + {docker_run} \ + -e JOB_TYPE="$JOB_TYPE" \ + "$DOCKER_IMG" \ + {timeout_cmd} /build/contrib/jenkins.sh + pipeline_binpkgs: "" + + - osmo-ci: + pipeline_build: false + pipeline_binpkgs: "" - osmo-ggsn: a1_name: GTP @@ -138,17 +231,19 @@ (GTP == "--enable-gtp-linux" && WITH_MANUALS == "0") || (GTP == "--disable-gtp-linux" && WITH_MANUALS == "1") cmd: | - {docker_run} \ + {docker_run_ccache} \ -e GTP="$GTP" \ -e WITH_MANUALS="$WITH_MANUALS" \ {docker_img} {timeout_cmd} /build/contrib/jenkins.sh - - osmo-gsm-manuals + - osmo-gsm-manuals: + pipeline_binpkgs: "debian:10 debian:12" - osmo_gsup: repos_url: '{gerrit_url}/erlang/{repos}' gerrit_project: 'erlang/{repos}' - cmd: '{docker_run} {docker_img_erlang} {timeout_cmd} /build/contrib/jenkins.sh' + cmd: '{docker_run_ccache} {docker_img_erlang} {timeout_cmd} /build/contrib/jenkins.sh' + pipeline_binpkgs: "" - osmo-hlr - osmo-iuh @@ -160,18 +255,19 @@ a2_name: WITH_MANUALS a2: !!python/tuple ["1", "0"] combination_filter: > - (IU == "--enable-iu" && WITH_MANUALS == "0") || - (IU == "--disable-iu" && WITH_MANUALS == "1") + (IU == "--enable-iu" && WITH_MANUALS == "1") || + (IU == "--disable-iu" && WITH_MANUALS == "0") cmd: | - {docker_run} \ + {docker_run_ccache} \ -e IU="$IU" \ -e WITH_MANUALS="$WITH_MANUALS" \ {docker_img} {timeout_cmd} /build/contrib/jenkins.sh - - osmo-pcap + - osmo-pcap: + pipeline_binpkgs: "centos:7 debian:10 debian:12" # centos7: SYS#6760 - osmo-pcu: - slave_axis: !!python/tuple [osmocom-master-debian9, rpi4-raspbian11] + slave_axis: !!python/tuple [osmocom-gerrit, raspbian] a1_name: FIRMWARE_VERSION a1: !!python/tuple [master, v2017.01, litecell15, oc2g] a2_name: with_vty @@ -181,24 +277,41 @@ a4_name: WITH_MANUALS a4: !!python/tuple ["1", "0"] combination_filter: > - (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="litecell15" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (with_vty == "True" && with_dsp == "oc2g" && FIRMWARE_VERSION=="oc2g" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "1" && label == "osmocom-master-debian9") || - (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "0" && label == "rpi4-raspbian11") + (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="litecell15" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (with_vty == "True" && with_dsp == "oc2g" && FIRMWARE_VERSION=="oc2g" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "1" && label == "osmocom-gerrit") || + (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master" && WITH_MANUALS == "0" && label == "raspbian") cmd: | - {docker_run} \ + DOCKER_IMG="{docker_img}" + case "$(arch)" in + arm*|aarch64) + DOCKER_IMG="$DOCKER_IMG-arm" + SETARCH_CMD="setarch linux32" + ;; + esac + {docker_run_ccache} \ -e FIRMWARE_VERSION="$FIRMWARE_VERSION" \ -e with_vty="$with_vty" \ -e with_dsp="$with_dsp" \ -e WITH_MANUALS="$WITH_MANUALS" \ - {docker_img} {timeout_cmd} /build/contrib/jenkins.sh + "$DOCKER_IMG" {timeout_cmd} $SETARCH_CMD /build/contrib/jenkins.sh - osmo-python-tests: repos_url: '{gerrit_url}/python/{repos}' gerrit_project: 'python/{repos}' + pipeline_binpkgs: "debian:10 debian:12" + + - pyosmocom: + repos_url: '{gerrit_url}/python/{repos}' + gerrit_project: 'python/{repos}' + pipeline_binpkgs: "debian:12" + a1_name: JOB_TYPE + a1: !!python/tuple ["test", "pylint", "docs"] + cmd: | + {docker_run} -e JOB_TYPE="$JOB_TYPE" {docker_img} {timeout_cmd} /build/contrib/jenkins.sh - osmo-sgsn: a1_name: IU @@ -206,10 +319,10 @@ a2_name: WITH_MANUALS a2: !!python/tuple ["1", "0"] combination_filter: > - (IU == "--enable-iu" && WITH_MANUALS == "0") || - (IU == "--disable-iu" && WITH_MANUALS == "1") + (IU == "--enable-iu" && WITH_MANUALS == "1") || + (IU == "--disable-iu" && WITH_MANUALS == "0") cmd: | - {docker_run} \ + {docker_run_ccache} \ -e IU="$IU" \ -e WITH_MANUALS="$WITH_MANUALS" \ {docker_img} {timeout_cmd} /build/contrib/jenkins.sh @@ -218,52 +331,117 @@ repos_url: '{gerrit_url}/erlang/{repos}' gerrit_project: 'erlang/{repos}' cmd: '{docker_run} {docker_img_erlang} {timeout_cmd} /build/contrib/jenkins.sh' + pipeline_binpkgs: "" - osmo-sip-connector - osmo-trx: - slave_axis: !!python/tuple [osmocom-master-debian9,rpi4-raspbian11] + slave_axis: !!python/tuple [osmocom-gerrit,raspbian] a1_name: INSTR - a1: !!python/tuple [--with-sse, --without-sse --with-neon, --with-neon-vfpv4] + a1: !!python/tuple [--with-sse, --without-sse, --with-neon, --with-neon-vfpv4] a2_name: WITH_MANUALS a2: !!python/tuple ["1", "0"] combination_filter: > - (INSTR == "--without-sse" && WITH_MANUALS == "1" && label == "osmocom-master-debian9") || - (INSTR == "--with-sse" && WITH_MANUALS == "0" && label == "osmocom-master-debian9") || - (INSTR == "--with-neon" && WITH_MANUALS == "0" && label == "rpi4-raspbian11") || - (INSTR == "--with-neon-vfpv4" && WITH_MANUALS == "0" && label == "rpi4-raspbian11") + (INSTR == "--without-sse" && WITH_MANUALS == "1" && label == "osmocom-gerrit") || + (INSTR == "--with-sse" && WITH_MANUALS == "0" && label == "osmocom-gerrit") || + (INSTR == "--with-neon" && WITH_MANUALS == "0" && label == "raspbian") || + (INSTR == "--with-neon-vfpv4" && WITH_MANUALS == "0" && label == "raspbian") cmd: | - {docker_run} \ + DOCKER_IMG="{docker_img}" + case "$(arch)" in + arm*|aarch64) + DOCKER_IMG="$DOCKER_IMG-arm" + SETARCH_CMD="setarch linux32" + ;; + esac + {docker_run_ccache} \ -e INSTR="$INSTR" \ -e WITH_MANUALS="$WITH_MANUALS" \ - {docker_img} {timeout_cmd} /build/contrib/jenkins.sh + "$DOCKER_IMG" {timeout_cmd} $SETARCH_CMD /build/contrib/jenkins.sh + + - osmocom-bb: + pipeline_binpkgs: "debian:12" + + - osmo-tetra: + pipeline_binpkgs: "" + + - osmo-sysmon: + pipeline_binpkgs: "debian:10 debian:12" - - osmocom-bb - - osmo-tetra - - osmo-sysmon - osmo-remsim - simtrace2 + - osmo-opencm3-projects: - docker_img: '$USER/debian-bullseye-jenkins' cmd: '{docker_run} {docker_img} {timeout_cmd} /build/contrib/jenkins.sh' - - osmo-asf4-dfu - - osmo-ccid-firmware + pipeline_binpkgs: "" + + - osmo-asf4-dfu: + pipeline_binpkgs: "" + + - osmo-ccid-firmware: + pipeline_binpkgs: "" + - osmo-e1d - osmo-cbc - - osmo-e1-recorder - - gapk + + - osmo-e1-recorder: + pipeline_binpkgs: "" + + - gapk: + pipeline_binpkgs: "debian:12" + - osmo-uecups - - osmo-el2tpd + + - osmo-el2tpd: + pipeline_binpkgs: "" + - osmo-smlc - osmo-gbproxy - osmo-hnodeb - - osmo-hnbgw - - osmo-upf + + - osmo-hnbgw: + a1_name: PFCP + a1: !!python/tuple ["1", "0"] + a2_name: WITH_MANUALS + a2: !!python/tuple ["1", "0"] + a3_name: NFTABLES + a3: !!python/tuple ["1", "0"] + combination_filter: > + (PFCP == "1" && WITH_MANUALS == "1" && NFTABLES == "1") || + (PFCP == "0" && WITH_MANUALS == "0" && NFTABLES == "0") + cmd: | + {docker_run_ccache} \ + -e PFCP="$PFCP" \ + -e WITH_MANUALS="$WITH_MANUALS" \ + -e NFTABLES="$NFTABLES" \ + {docker_img} {timeout_cmd} /build/contrib/jenkins.sh + + - osmo-upf: + pipeline_binpkgs: "debian:11 debian:12" - pysim: - slave_axis: !!python/tuple [simtester] concurrent: false - cmd: '{timeout_cmd} ./contrib/jenkins.sh' + slave_axis: !!python/tuple [simtester,osmocom-gerrit] + a2_name: JOB_TYPE + a2: !!python/tuple ["test", "distcheck", "pylint", "docs"] + combination_filter: > + (JOB_TYPE == "test" && label == "simtester") || + (JOB_TYPE == "distcheck" && label == "osmocom-gerrit") || + (JOB_TYPE == "pylint" && label == "osmocom-gerrit") || + (JOB_TYPE == "docs" && label == "osmocom-gerrit") + cmd: | + case "$JOB_TYPE" in + "test") + {timeout_cmd} ./contrib/jenkins.sh + ;; + *) + {docker_run} \ + -e JOB_TYPE="$JOB_TYPE" \ + {docker_img} \ + {timeout_cmd} /build/contrib/jenkins.sh + ;; + esac + pipeline_binpkgs: "" - osmo-ttcn3-hacks: slave_axis: !!python/tuple [ttcn3] @@ -271,36 +449,233 @@ docker run \ --rm \ -v "$PWD:/build" \ - "registry.osmocom.org/osmocom-build/debian-bullseye-titan" \ + "registry.osmocom.org/osmocom-build/debian-bookworm-titan" \ {timeout_cmd} \ - sh -e -x -c " - useradd --uid=1000 build; - cd /build; - su build -c 'make deps'; - su build -c 'make clean'; - su build -c 'make compile'; - " - - - dahdi-tools + sh -e -x -c ' + useradd --uid=1000 build + for i in /osmo-ttcn3-hacks/deps/*/; do + if ! [ -e /build/deps/"$(basename "$i")" ]; then + ln -s "$i" /build/deps/ + fi + done + su build -c "make -C /build compile" + ' + pipeline_binpkgs: "" + + - dahdi-tools: + pipeline_lint: false + pipeline_binpkgs: "" jobs: - 'gerrit-{repos}' + - 'gerrit-{repos}-build' - job-template: name: 'gerrit-{repos}' + project-type: pipeline + concurrent: true + parameters: + - bool: + name: PIPELINE_BUILD + description: Enable the build job (runs contrib/jenkins.sh) + default: '{obj:pipeline_build}' + - bool: + name: PIPELINE_LINT + description: Enable the lint job + default: '{obj:pipeline_lint}' + - string: + name: REPO_URL + description: Clone URL, to be passed to jobs started in the pipeline + default: '{obj:repos_url}' + - string: + name: PIPELINE_BINPKGS + description: | + Enable the binpkgs job (build deb/rpm packages) for the given space + separated distributions. Empty list disables the binpkgs job. The + distributions must have binary packages in the osmocom:master + repository. + default: '{obj:pipeline_binpkgs}' + dsl: | + def run_job(display_name, job_name, comment_type=null, distro=null) {{ + try {{ + echo "pipeline_${{display_name}}: running job ${{job_name}}" + + // IMPORTANT: Keep gerrit-verifications-parameters.yaml.inc in sync + // with the list of parameters here, and make sure all jobs passed + // to run_job() include the .yaml.inc file. (OS#6261) + build job: job_name, parameters: [ + string(name: "COMMENT_TYPE", value: comment_type), + string(name: "DISTRO", value: distro), + string(name: "GERRIT_BRANCH", value: "${{env.GERRIT_BRANCH}}"), + string(name: "GERRIT_CHANGE_NUMBER", value: "${{env.GERRIT_CHANGE_NUMBER}}"), + string(name: "GERRIT_HOST", value: "${{env.GERRIT_HOST}}"), + string(name: "GERRIT_PATCHSET_NUMBER", value: "${{env.GERRIT_PATCHSET_NUMBER}}"), + string(name: "GERRIT_PATCHSET_REVISION", value: "${{env.GERRIT_PATCHSET_REVISION}}"), + string(name: "GERRIT_PATCHSET_UPLOADER_NAME", value: "${{env.GERRIT_PATCHSET_UPLOADER_NAME}}"), + string(name: "GERRIT_PORT", value: "${{env.GERRIT_PORT}}"), + string(name: "GERRIT_PROJECT", value: "${{env.GERRIT_PROJECT}}"), + string(name: "GERRIT_REFSPEC", value: "${{env.GERRIT_REFSPEC}}"), + string(name: "GERRIT_REPO_URL", value: "${{env.REPO_URL}}"), + string(name: "PIPELINE_BUILD_URL", value: "${{env.BUILD_URL}}"), + string(name: "PROJECT_NAME", value: "{repos}"), + ] + echo "pipeline_${{display_name}}: SUCCESS" + }} catch (Exception e) {{ + echo "pipeline_${{display_name}}: FAILED" + }} + }} + + pipeline {{ + agent none + stages {{ + stage("Verification") {{ + parallel {{ + + // Run the comment job to add the pipeline link to gerrit + stage("Start Comment") {{ + steps {{ + script {{ + run_job("comment_start", "gerrit-verifications-comment", "start") + }} + }} + }} + + stage("Build") {{ + when {{ + expression {{ params.PIPELINE_BUILD }} + }} + steps {{ + script {{ + run_job("build", "gerrit-{repos}-build") + }} + }} + }} + + stage("Lint") {{ + when {{ + expression {{ params.PIPELINE_LINT }} + }} + steps {{ + script {{ + run_job("lint", "gerrit-lint") + }} + }} + }} + + // Generating binpkgs stages is not possible if we want to run + // them in parallel and not have another job that just waits + // until they complete. + + stage("binpkgs-0") {{ + when {{ + expression {{ params.PIPELINE_BINPKGS.split().size() > 0 }} + }} + steps {{ + script {{ + distro = params.PIPELINE_BINPKGS.split()[0] + run_job(distro, "gerrit-binpkgs", null, distro) + }} + }} + }} + + stage("binpkgs-1") {{ + when {{ + expression {{ params.PIPELINE_BINPKGS.split().size() > 1 }} + }} + steps {{ + script {{ + distro = params.PIPELINE_BINPKGS.split()[1] + run_job(distro, "gerrit-binpkgs", null, distro) + }} + }} + }} + + stage("binpkgs-2") {{ + when {{ + expression {{ params.PIPELINE_BINPKGS.split().size() > 2 }} + }} + steps {{ + script {{ + distro = params.PIPELINE_BINPKGS.split()[2] + run_job(distro, "gerrit-binpkgs", null, distro) + }} + }} + }} + + }} // end of parallel + }} // end of Verification stage + + // Run the comment job to get successful/failed links and add a + // comment + vote to gerrit + stage("Result Comment") {{ + steps {{ + script {{ + run_job("comment_result", "gerrit-verifications-comment", "result") + }} + }} + }} + + }} + }} + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + properties: + - build-discarder: + days-to-keep: 30 + num-to-keep: 1000 + description: | + Pipeline of CI for patches sent to + <a href="https://gerrit.osmocom.org/#/q/status:open+project:{repos}">{repos}</a> + <br/><br/> + <b>Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY!</b> + + scm: + - git: + url: '{obj:repos_url}' + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + refspec: $GERRIT_REFSPEC + name: + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + submodule: + recursive: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event: + exclude-drafts: true + exclude-no-code-change: true + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{obj:gerrit_project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: false + failed: false + unstable: false + notbuilt: false + silent: true # comment + vote is done in gerrit-pipeline-result.yml + escape-quotes: false + server-name: gerrit.osmocom.org + +- job-template: + name: 'gerrit-{repos}-build' project-type: matrix - node: '{node}' concurrent: '{obj:concurrent}' disabled: '{obj:disabled}' retry-count: 3 # scm checkout properties: - build-discarder: days-to-keep: 30 - num-to-keep: 120 - artifact-days-to-keep: -1 - artifact-num-to-keep: -1 + num-to-keep: 1000 description: | - Pending gerrit code reviews of + Build job of CI for patches sent to <a href="https://gerrit.osmocom.org/#/q/status:open+project:{repos}">{repos}</a> <br/><br/> <b>Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY!</b> @@ -345,31 +720,13 @@ submodule: recursive: true - triggers: - - gerrit: - trigger-on: - - patchset-created-event: - exclude-drafts: true - exclude-no-code-change: true - projects: - - project-compare-type: 'PLAIN' - project-pattern: '{obj:gerrit_project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**' - skip-vote: - successful: false - failed: false - unstable: false - notbuilt: false - silent: false - escape-quotes: false - no-name-and-email: false - trigger-for-unreviewed-patches: true - server-name: gerrit.osmocom.org + parameters: + !include: gerrit-verifications-parameters.yaml.inc builders: - shell: '{obj:cmd}' + # Remove workspace on success to free up space + - shell: 'rm -rf "$WORKSPACE"' publishers: - warnings: |