Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
dump grafana build output if build fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Jun 17, 2020
1 parent 267bca0 commit 03da223
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dev/grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ GRAFANA_DISK="${HOME}/.sourcegraph-dev/data/grafana"
IMAGE=sourcegraph/grafana:dev
CONTAINER=grafana

# quickly build image - should do this because the image has a Sourcegraph wrapper program
# see /docker-images/grafana/cmd/grafana-wrapper for more details
IMAGE=${IMAGE} CACHE=true ./docker-images/grafana/build.sh >/dev/null 2>&1

# docker containers must access things via docker host on non-linux platforms
CONFIG_SUB_DIR="all"
SRC_FRONTEND_INTERNAL="host.docker.internal:3090"
Expand Down Expand Up @@ -55,6 +51,11 @@ mkdir -p "${GRAFANA_LOGS}"
# display it in the normal case.
GRAFANA_LOG_FILE="${GRAFANA_LOGS}/grafana.log"

# Quickly build image - should do this because the image has a Sourcegraph wrapper program
# see /docker-images/grafana/cmd/grafana-wrapper for more details
IMAGE=${IMAGE} CACHE=true ./docker-images/grafana/build.sh >"${GRAFANA_LOG_FILE}" 2>&1 ||
(BUILD_EXIT_CODE=$? && echo "build failed; dumping log:" && cat "${GRAFANA_LOG_FILE}" && exit $BUILD_EXIT_CODE)

function finish() {
GRAFANA_EXIT_CODE=$?

Expand Down

0 comments on commit 03da223

Please sign in to comment.