--- /dev/null
+#!/bin/bash -ex
+
+# note: the failed_build_status call relies on normalized variable names that
+# are infered by the builds themselves. If the build fails before these are
+# set, they will be posted with empty values
+BRANCH=`branch_slash_filter $BRANCH`
+
+# This build-failure job will only have one word for the $DISTROS parameter
+# because all the failed job's paramters are passed to this job when it's triggered.
+case $DISTROS in
+ focal)
+ NORMAL_DISTRO="ubuntu"
+ NORMAL_DISTRO_VERSION="focal"
+ ;;
+ bionic)
+ NORMAL_DISTRO="ubuntu"
+ NORMAL_DISTRO_VERSION="bionic"
+ ;;
+ centos8)
+ NORMAL_DISTRO="centos"
+ NORMAL_DISTRO_VERSION="8"
+ ;;
+ centos7)
+ NORMAL_DISTRO="centos"
+ NORMAL_DISTRO_VERSION="7"
+ ;;
+ leap15)
+ NORMAL_DISTRO="opensuse"
+ NORMAL_DISTRO_VERSION="15.2"
+ ;;
+ windows)
+ NORMAL_DISTRO="windows"
+ NORMAL_DISTRO_VERSION="1809"
+ ;;
+ *)
+ echo "Unable to determine distro.\nThis job will be unable to notify shaman of a build failure and it will remain in \"building\" indefinitely."
+ exit 1
+ ;;
+esac
+
+# update shaman with the failed build status
+failed_build_status "ceph" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $ARCHS
--- /dev/null
+- job:
+ name: build-failure
+ description: "This job gets triggered by ceph-dev-*-{setup,build} when the job fails.\r\nThis is useful for when a Jenkins builder crashes and can't run the failure script itself."
+ project-type: freestyle
+ defaults: global
+ quiet-period: 5
+ block-downstream: false
+ block-upstream: false
+ properties:
+ - build-discarder:
+ days-to-keep: 14
+ discard-old-builds: true
+
+ builders:
+ - shell:
+ !include-raw:
+ - ../../../scripts/build_utils.sh
+ - ../../build/failure
+
+ wrappers:
+ - credentials-binding:
+ - text:
+ credential-id: shaman-api-key
+ variable: SHAMAN_API_KEY
+
- FAILURE
- ABORTED
build-steps:
- - inject:
- properties-file: ${WORKSPACE}/build_info
- - shell:
- !include-raw:
- - ../../../scripts/build_utils.sh
- - ../../build/failure
+ - trigger-builds:
+ - project: 'build-failure'
+ current-parameters: true
wrappers:
- inject-passwords:
- FAILURE
- ABORTED
build-steps:
- - inject:
- properties-file: ${WORKSPACE}/build_info
- - shell:
- !include-raw:
- - ../../../scripts/build_utils.sh
- - ../../build/failure
+ - trigger-builds:
+ - project: 'build-failure'
+ current-parameters: true
wrappers:
- inject-passwords: