forked from bloomberg/goldpinger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 925 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name ?= goldpinger
version ?= 1.1.0
bin ?= goldpinger
pkg ?= "github.com/bloomberg/goldpinger"
tag = $(name):$(version)
goos ?= ${GOOS}
namespace ?= ""
files = $(shell find . -iname "*.go")
bin/$(bin): $(files)
GOOS=${goos} PKG=${pkg} ARCH=amd64 VERSION=${version} BIN=${bin} ./build/build.sh
clean:
rm -rf ./vendor
rm -f ./bin/$(bin)
vendor:
rm -rf ./vendor
dep ensure -v -vendor-only
swagger:
swagger generate server -t pkg -f ./swagger.yml --exclude-main -A goldpinger && \
swagger generate client -t pkg -f ./swagger.yml -A goldpinger
build-multistage:
docker build -t $(tag) -f ./Dockerfile .
build: GOOS=linux
build: bin/$(bin)
docker build -t $(tag) -f ./build/Dockerfile-simple .
tag:
docker tag $(tag) $(namespace)$(tag)
push:
docker push $(namespace)$(tag)
run:
go run ./cmd/goldpinger/main.go
version:
@echo $(tag)
.PHONY: clean vendor swagger build build-multistage tag push run version