osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ci/+/35267?usp=email
)
Change subject: coverity: add job to check for failed uploads
......................................................................
coverity: add job to check for failed uploads
Related: SYS#6685
Change-Id: Ideabcb30f9f8f365acff2de7751eb74a2762a7a6
---
A coverity/badge_status.sh
M jobs/README.adoc
A jobs/coverity-status.yml
3 files changed, 85 insertions(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/coverity/badge_status.sh b/coverity/badge_status.sh
new file mode 100755
index 0000000..72fdcce
--- /dev/null
+++ b/coverity/badge_status.sh
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+# Check if the coverity badge says "failed". This can happen for example if we
+# use a coverity version that is no longer supported, and it doesn't fail in
+# any other obvious way. (SYS#6685)
+
+# Download the status badge svg image, which contains the word "passed" when
+# it was successful, and "failed" when it failed.
+# Example: <text x="62" y="14">passed 91 new
defects</text>
+
+BADGE="_temp/badge.svg"
+
+mkdir -p _temp
+rm -f "$BADGE"
+
+wget --no-verbose -O "$BADGE"
"https://scan.coverity.com/projects/7523/badge.svg"
+
+if grep -q passed "$BADGE" && ! grep -q failed "$BADGE";
then
+ echo "Success"
+ exit 0
+fi
+
+echo
+echo "ERROR: coverity failed!"
+echo
+echo "Find the error details here:"
+echo "https://scan.coverity.com/projects/osmocom?tab=overview"
+echo
+exit 1
diff --git a/jobs/README.adoc b/jobs/README.adoc
index c37b3bb..eb14152 100644
--- a/jobs/README.adoc
+++ b/jobs/README.adoc
@@ -144,5 +144,6 @@
04:XX osmocom-release-manuals
05:XX osmocom-release-tarballs
06:XX repo-install-test
+ 06:XX coverity-status (runs intentionally much later than the coverity job)
master-builds: to avoid complexity, these run throughout the day (H H * * *).
diff --git a/jobs/coverity-status.yml b/jobs/coverity-status.yml
new file mode 100644
index 0000000..cb7522e
--- /dev/null
+++ b/jobs/coverity-status.yml
@@ -0,0 +1,46 @@
+# Check if the coverity badge says "failed". This can happen for example if we
+# use a coverity version that is no longer supported, and it doesn't fail in
+# any other obvious way. (SYS#6685)
+- project:
+ name: osmocom-coverity-status
+ jobs:
+ - osmocom-coverity-status
+
+- job:
+ name: 'osmocom-coverity-status'
+ project-type: freestyle
+ defaults: global
+ description: |
+ Verify that the coverity badge says "passed" and not "failed"
(SYS#6685).
+ <br>
+ <br>
+ <img
src="https://scan.coverity.com/projects/7523/badge.svg">
+ builders:
+ - shell: |
+ coverity/badge_status.sh
+ publishers:
+ - email:
+ recipients: 'jenkins-notifications(a)lists.osmocom.org'
+ notify-every-unstable-build: true
+ properties:
+ - build-discarder:
+ days-to-keep: 30
+ num-to-keep: 30
+ parameters:
+ - string:
+ name: BRANCH
+ description: osmo-ci.git branch
+ default: 'origin/master'
+ scm:
+ - git:
+ url:
https://gerrit.osmocom.org/osmo-ci
+ git-config-name: 'Jenkins Builder'
+ git-config-email: 'jenkins(a)osmocom.org'
+ branches:
+ - '$BRANCH'
+ triggers:
+ - timed: "H 06 * * *"
+ publishers:
+ - email:
+ notify-every-unstable-build: true
+ recipients: 'jenkins-notifications(a)lists.osmocom.org'
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ci/+/35267?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ideabcb30f9f8f365acff2de7751eb74a2762a7a6
Gerrit-Change-Number: 35267
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged