grafana/scripts/ci-job-failed.sh
Hugo Häggmark 432f36024b
Build: Reports times and outcomes from CircleCI jobs (#20474)
* Build: Adds start and stop job

* WIP: Testing passing env variables

* Fix: Fixes shellcheck errors

* WIP: Uses $BASH_ENV

* WIP: bash update

* WIP: adds stats echo

* WIP: Adds reporting

* Fix: Fixes reporting

* Fix: Fixes reporting

* Refactor: Adds outcomes and timing to build-fast-frontend

* Build: Adds stats to all jobs

* Fix: Fixes invalid yml

* Refactor: Adds stats to integration tests

* Refactor: Run stats on master only
2019-11-20 07:21:07 +01:00

17 lines
507 B
Bash
Executable File

#!/bin/bash
# shellcheck source=./scripts/helpers/exit-if-fail.sh
source "$(dirname "$0")/helpers/exit-if-fail.sh"
echo -e "Report build times and build outcome"
start=$GF_JOB_START
runtime=$((($(date +%s%N) - start)/1000000))
echo -e "The job $CIRCLE_JOB took $runtime (ms)"
if [ "${CIRCLE_BRANCH}" == "master" ]; then
exit_if_fail ./scripts/ci-metrics-publisher.sh "grafana.ci-buildtimes.$CIRCLE_JOB=$runtime"
exit_if_fail ./scripts/ci-metrics-publisher.sh "grafana.ci-buildoutcome.$CIRCLE_JOB=0"
fi