From bfbba7ecb6151be41a4daa46734c5c6bf489f1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 22 Apr 2017 22:33:12 -0700 Subject: [PATCH 1/2] Fix mock data usage with 'make run-docker' docker target doesn't work with file:// based ALERTMANAGER_URI since it doesn't have same paths inside the image, fix it by mapping a volume --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e7c6639ae..f961d7e60 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ NAME := unsee VERSION := $(shell git describe --tags --always --dirty='-dev') # Alertmanager instance used when running locally, points to mock data -ALERTMANAGER_URI := file://$(CURDIR)/mock/0.5 +MOCK_PATH := $(CURDIR)/mock/0.5 +ALERTMANAGER_URI := file://$(MOCK_PATH) # Listen port when running locally PORT := 8080 @@ -62,6 +63,7 @@ run-docker: docker-image docker run \ --name $(NAME) \ $(DOCKER_ARGS) \ + -v $(MOCK_PATH):$(MOCK_PATH) \ -e ALERTMANAGER_URI=$(ALERTMANAGER_URI) \ -e COLOR_LABELS_UNIQUE="instance cluster" \ -e COLOR_LABELS_STATIC="job" \ From 0e7b40c9959bd6fdd41937510cfae8cb114ccd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 23 Apr 2017 08:51:32 -0700 Subject: [PATCH 2/2] Reformat run-docker target --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f961d7e60..068953350 100644 --- a/Makefile +++ b/Makefile @@ -62,12 +62,12 @@ run-docker: docker-image @docker rm -f $(NAME) || true docker run \ --name $(NAME) \ - $(DOCKER_ARGS) \ - -v $(MOCK_PATH):$(MOCK_PATH) \ + $(DOCKER_ARGS) \ + -v $(MOCK_PATH):$(MOCK_PATH) \ -e ALERTMANAGER_URI=$(ALERTMANAGER_URI) \ - -e COLOR_LABELS_UNIQUE="instance cluster" \ - -e COLOR_LABELS_STATIC="job" \ - -e DEBUG="$(GIN_DEBUG)" \ + -e COLOR_LABELS_UNIQUE="instance cluster" \ + -e COLOR_LABELS_STATIC="job" \ + -e DEBUG="$(GIN_DEBUG)" \ -e PORT=$(PORT) \ -p $(PORT):$(PORT) \ $(NAME):$(VERSION)