-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
37 lines (28 loc) · 1.18 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
NAME = $(shell awk -F\" '/^const Name/ { print $$2 }' main.go)
VERSION = $(shell awk -F\" '/^const Version/ { print $$2 }' main.go)
TESTDEPS = $(shell go list -f '{{range .TestImports}}{{.}} {{end}}' $(shell glide novendor))
DOCKERREPO=ciscocloud
all: deps build
deps:
glide install --strip-vcs --strip-vendor --update-vendored
find vendor -not -name '*.go' -not -name '*.s' -not -name '*.pl' -not -name '*.c' -not -name LICENSE -type f -delete
echo $(TESTDEPS) | xargs -n1 go get
updatedeps:
glide update --strip-vcs --strip-vendor --update-vendored
find vendor -not -name '*.go' -not -name '*.s' -not -name '*.pl' -not -name '*.c' -not -name LICENSE -type f -delete
build:
go build .
quicktest:
go test $(shell glide novendor) -timeout=30s -parallel=4
test: quicktest
go vet $(shell glide novendor)
docker:
find . -depth -name ".DS_Store" -exec rm {} \;
docker build -t $(DOCKERREPO)/$(NAME) .
docker tag $(DOCKERREPO)/$(NAME) $(DOCKERREPO)/$(NAME):$(VERSION)
pushedge: docker
docker tag -f $(DOCKERREPO)/$(NAME) $(DOCKERREPO)/$(NAME):edge
docker push $(DOCKERREPO)/$(NAME):edge
push: docker
docker push $(DOCKERREPO)/$(NAME):$(VERSION)
docker push $(DOCKERREPO)/$(NAME):latest