@@ -8,19 +8,20 @@ FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH)))
88OS ?= $(shell uname -s | tr '[A-Z]' '[a-z]')
99ARCH ?= $(shell uname -m)
1010GOARCH ?= $(shell go env GOARCH)
11+ BIN_NAME ?= observatorium-api
1112
1213VERSION := $(strip $(shell [ -d .git ] && git describe --always --tags --dirty) )
1314BUILD_DATE := $(shell date -u +"% Y-% m-% d")
1415BUILD_TIMESTAMP := $(shell date -u +"% Y-% m-% dT% H:% M:% S% Z")
1516VCS_BRANCH := $(strip $(shell git rev-parse --abbrev-ref HEAD) )
1617VCS_REF := $(strip $(shell [ -d .git ] && git rev-parse --short HEAD) )
17- DOCKER_REPO ?= quay.io/observatorium/observatorium
18+ DOCKER_REPO ?= quay.io/observatorium/api
1819
1920CONTAINER_CMD := docker run --rm \
2021 -u="$(shell id -u) :$(shell id -g) " \
2122 -v "$(shell go env GOCACHE) :/.cache/go-build" \
22- -v "$(PWD ) :/go/src/github.com/observatorium/observatorium :Z" \
23- -w "/go/src/github.com/observatorium/observatorium " \
23+ -v "$(PWD ) :/go/src/github.com/observatorium/api :Z" \
24+ -w "/go/src/github.com/observatorium/api " \
2425 -e USER=deadbeef \
2526 -e GO111MODULE=on \
2627 quay.io/coreos/jsonnet-ci
@@ -50,11 +51,11 @@ PROTOC_VERSION ?= 3.13.0
5051
5152SERVER_CERT ?= $(CERT_DIR ) /server.pem
5253
53- default : observatorium
54- all : clean lint test observatorium generate validate
54+ default : $( BIN_NAME )
55+ all : clean lint test $( BIN_NAME ) generate validate
5556
56- tmp/help.txt : observatorium $(TMP_DIR )
57- ./observatorium --help & > $(TMP_DIR ) /help.txt || true
57+ tmp/help.txt : $( BIN_NAME ) $(TMP_DIR )
58+ ./$( BIN_NAME ) --help & > $(TMP_DIR ) /help.txt || true
5859
5960tmp/load_help.txt : $(TMP_DIR )
6061 -./test/load.sh -h > $(TMP_DIR ) /load_help.txt 2& > 1
@@ -67,11 +68,11 @@ benchmark.md: $(EMBEDMD) tmp/load_help.txt
6768 PATH=$$ PATH:$(BIN_DIR ) :$(FIRST_GOPATH ) /bin ./test/load.sh -r 300 -c 1000 -m 3 -q 10 -o gnuplot
6869 $(EMBEDMD ) -w docs/benchmark.md
6970
70- observatorium : deps main.go $(wildcard * .go) $(wildcard * /* .go)
71- CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(GOARCH ) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -a -ldflags ' -s -w' -o $@ .
71+ $( BIN_NAME ) : deps main.go $(wildcard * .go) $(wildcard * /* .go)
72+ CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(GOARCH ) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -a -ldflags ' -s -w' -o $( BIN_NAME ) .
7273
7374.PHONY : build
74- build : observatorium
75+ build : $( BIN_NAME )
7576
7677.PHONY : run
7778run : build $(THANOS ) $(DEX ) $(LOKI ) generate-cert
@@ -115,7 +116,7 @@ clean:
115116 -rm tmp/help.txt
116117 -rm -rf tmp/bin
117118 -rm -rf tmp/src
118- -rm observatorium
119+ -rm $( BIN_NAME )
119120
120121ratelimit/gubernator/proto/google :
121122 mkdir -p $(TMP_DIR ) /src/grpc-gateway
@@ -211,11 +212,11 @@ $(SHELLCHECK): $(BIN_DIR)
211212 curl -sNL " https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.$( OS) .$( ARCH) .tar.xz" | tar --strip-components=1 -xJf - -C $(BIN_DIR )
212213
213214$(MOCKPROVIDER ) : | deps $(BIN_DIR )
214- go build -tags tools -o $@ github.com/observatorium/observatorium /test/mock
215+ go build -tags tools -o $@ github.com/observatorium/api /test/mock
215216
216217$(GENERATE_TLS_CERT ) : | deps $(BIN_DIR )
217218 # A thin wrapper around github.com/cloudflare/cfssl
218- go build -tags tools -o $@ github.com/observatorium/observatorium /test/tls
219+ go build -tags tools -o $@ github.com/observatorium/api /test/tls
219220
220221$(PROTOC ) : $(TMP_DIR ) $(BIN_DIR )
221222 @PROTOC_VERSION=" $( PROTOC_VERSION) " TMP_DIR=" $( TMP_DIR) " BIN_DIR=" $( BIN_DIR) " scripts/install_protoc.sh
0 commit comments