mirror of
https://github.com/prymitive/karma
synced 2026-02-13 20:59:53 +00:00
Cleanup Makefile
Rename 'make build' to 'make docker-image' so it's more obvious what it's doing Initialize git submodules automatically when needed, so users don't need to do it manually
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.build
|
||||
unsee
|
||||
|
||||
15
Makefile
15
Makefile
@@ -1,14 +1,19 @@
|
||||
VERSION := $(shell git describe --tags --always --dirty='-dev')
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
.build/deps.ok: .gitmodules
|
||||
git submodule update --init --recursive
|
||||
mkdir -p .build
|
||||
touch $@
|
||||
|
||||
.PHONY: docker-image
|
||||
docker-image:
|
||||
docker build --build-arg VERSION=$(VERSION) -t unsee:$(VERSION) .
|
||||
|
||||
ALERTMANAGER_URI := https://raw.githubusercontent.com/prymitive/alertmanager-demo-api/master
|
||||
PORT := 8080
|
||||
|
||||
.PHONY: demo
|
||||
demo: build
|
||||
demo: docker-image
|
||||
@docker rm -f unsee-dev || true
|
||||
docker run \
|
||||
--name unsee-dev \
|
||||
@@ -18,7 +23,7 @@ demo: build
|
||||
unsee:$(VERSION)
|
||||
|
||||
.PHONY: dev
|
||||
dev:
|
||||
dev: .build/deps.ok
|
||||
go build -v -ldflags "-X main.version=${VERSION:-dev}" && \
|
||||
DEBUG=true \
|
||||
ALERTMANAGER_URI=$(ALERTMANAGER_URI) \
|
||||
@@ -26,7 +31,7 @@ dev:
|
||||
./unsee
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
lint: .build/deps.ok
|
||||
@golint ./... | (grep -v ^vendor/ || true)
|
||||
|
||||
.PHONY: test
|
||||
|
||||
22
README.md
22
README.md
@@ -9,9 +9,19 @@ to alert data, therefore safe to be accessed by wider audience.
|
||||
|
||||
## Building and running
|
||||
|
||||
### Running in dev mode
|
||||
|
||||
Requires Go.
|
||||
|
||||
make dev
|
||||
|
||||
Will compile unsee and run the binary (not using Docker), by default will use
|
||||
same port and Alertmanager URI as demo mode. This is intended for local
|
||||
development.
|
||||
|
||||
### Build a Docker image
|
||||
|
||||
make build
|
||||
make docker-image
|
||||
|
||||
This will build a Docker image from sources.
|
||||
|
||||
@@ -27,16 +37,6 @@ variables. Example:
|
||||
|
||||
make PORT=5000 ALERTMANAGER_URI=https://alertmanager.unicorn.corp run
|
||||
|
||||
### Running in dev mode
|
||||
|
||||
Requires Go.
|
||||
|
||||
make dev
|
||||
|
||||
Will compile unsee and run the binary (not using Docker), by default will use
|
||||
same port and Alertmanager URI as demo mode. This is intended for testing
|
||||
changes.
|
||||
|
||||
### Environment variables
|
||||
|
||||
#### ALERTMANAGER_URI
|
||||
|
||||
Reference in New Issue
Block a user