-
Notifications
You must be signed in to change notification settings - Fork 126
/
Makefile
45 lines (34 loc) · 1.24 KB
/
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
CGO_ENABLED=0
GOOS=linux
GOARCH=amd64
COMMIT=`git rev-parse --short HEAD`
APP=interlock
REPO?=ehazlett/$(APP)
TAG?=latest
BUILD?=-dev
all: image
deps:
@glide i
# this causes an import conflict with tests. remove this vendor. le sigh
@rm -rf vendor/github.com/docker/docker/vendor/github.com/docker/go-connections
build: build-static
build-app:
@echo " -> Building $(TAG)$(BUILD)"
@cd cmd/$(APP) && go build -v -ldflags "-w -X github.com/$(REPO)/version.GitCommit=$(COMMIT) -X github.com/$(REPO)/version.Build=$(BUILD)" .
@echo "Built $$(./cmd/$(APP)/$(APP) -v)"
build-static:
@echo " -> Building $(TAG)$(BUILD)"
@cd cmd/$(APP) && go build -v -a -tags "netgo static_build" -installsuffix netgo -ldflags "-w -X github.com/$(REPO)/version.GitCommit=$(COMMIT) -X github.com/$(REPO)/version.Build=$(BUILD)" .
@echo "Built $$(./cmd/$(APP)/$(APP) -v)"
image:
@docker build --build-arg TAG=$(TAG) --build-arg BUILD=$(BUILD) -t $(REPO):$(TAG) .
@echo "Image created: $(REPO):$(TAG)"
integration: image
# TODO
test-integration:
@go test -v $(TEST_ARGS) ./test/integration/...
test:
@go test -v -cover -race $(TEST_ARGS) $$(glide novendor | grep -v ./test)
clean:
@rm cmd/$(APP)/$(APP)
.PHONY: deps build build-static build-app build-image image clean test