From f52c26a695edf456dce65bf24235c3a3382a891f Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 25 Oct 2022 12:27:53 +0200 Subject: [PATCH] jobs: add osmocom-obs-check-builders Add a job that checks if the amount of connected builders to the OBS server matches what we expect. This should prevent what we had today, that it only was noticed by chance several days after all builders failed to connect and the packages were outdated since then. I'm not sure if there is a proper api to do this check, but I don't expect the string we check for to change often so this should work fine. Change-Id: I6e7c1f206551722d6bfe1631b9c1da8d34d85ba8 --- jobs/osmocom-obs-check-builders.yml | 28 ++++++++++++++++++++++++++++ scripts/obs/check_builders.sh | 11 +++++++++++ 2 files changed, 39 insertions(+) create mode 100644 jobs/osmocom-obs-check-builders.yml create mode 100755 scripts/obs/check_builders.sh diff --git a/jobs/osmocom-obs-check-builders.yml b/jobs/osmocom-obs-check-builders.yml new file mode 100644 index 00000000..f378ec1c --- /dev/null +++ b/jobs/osmocom-obs-check-builders.yml @@ -0,0 +1,28 @@ +--- +- project: + name: Osmocom_OBS_check_builders + jobs: + - Osmocom_OBS_check_builders + +- job-template: + name: 'Osmocom_OBS_check_builders' + project-type: freestyle + defaults: global + description: | + Verify that the expected amount of builders are connected to + obs.osmocom.org. + builders: + - shell: | + scripts/obs/check_builders.sh + scm: + - git: + branches: + - 'origin/master' + url: https://gerrit.osmocom.org/osmo-ci + triggers: + - timed: "@hourly" + node: obs + publishers: + - email: + notify-every-unstable-build: true + recipients: 'jenkins-notifications@lists.osmocom.org' diff --git a/scripts/obs/check_builders.sh b/scripts/obs/check_builders.sh new file mode 100755 index 00000000..609c467c --- /dev/null +++ b/scripts/obs/check_builders.sh @@ -0,0 +1,11 @@ +#!/bin/sh -ex +count=14 +wget -q https://obs.osmocom.org -O index.html + +if ! grep -q " of $count build hosts" index.html; then + grep "build hosts" index.html + set +x + echo + echo "ERROR: expected $count builders to be connected to OBS!" + echo +fi