-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (30 loc) · 881 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
CWD:=$(shell pwd)
GO:=GO15VENDOREXPERIMENT=1 go
VERSION:=0.8
IMAGE_NAME=robinmonjo/alpine-dock:dev
build:
ifeq ($(IN_CONTAINER), true)
$(GO) build -ldflags="-X main.version=$(VERSION)"
else
docker build -t $(IMAGE_NAME) .
endif
binary:
$(GO) build -ldflags="-X main.version=$(VERSION)"
test: build
ifeq ($(IN_CONTAINER), true)
bash -c 'cd port && $(GO) test'
bash -c 'cd logrotate && $(GO) test'
bash -c 'cd iowire && $(GO) test'
bash -c 'cd procfs && $(GO) test'
else
docker run -it -w "/go/src/github.com/robinmonjo/dock" -e IN_CONTAINER=true $(IMAGE_NAME) bash -c 'make test'
endif
integration: build
TEST_IMAGE=$(IMAGE_NAME) bash -c 'cd integration && $(GO) test'
release:
mkdir -p release
GOOS=linux $(GO) build -ldflags="-X main.version=$(VERSION)" -o release/dock
cd release && tar -zcf dock-v$(VERSION).tgz dock
rm release/dock
vendor:
bash vendor.sh