forked from fabiolb/fabio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (66 loc) · 2.14 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# do not specify a full path for go since travis will fail
GO = GOGC=off go
GOFLAGS = -ldflags "-X main.version=$(shell git describe --tags)"
GOVENDOR = $(shell which govendor)
VENDORFMT = $(shell which vendorfmt)
all: build test
help:
@echo "build - go build"
@echo "install - go install"
@echo "test - go test"
@echo "gofmt - go fmt"
@echo "vet - go vet"
@echo "linux - go build linux/amd64"
@echo "release - build/release.sh"
@echo "homebrew - build/homebrew.sh"
@echo "buildpkg - build/build.sh"
@echo "pkg - build, test and create pkg/fabio.tar.gz"
@echo "clean - remove temp files"
build: checkdeps vendorfmt vet gofmt
$(GO) build -i $(GOFLAGS)
$(GO) test -i ./...
test: checkdeps vendorfmt gofmt
$(GO) test -v -test.timeout 15s `go list ./... | grep -v '/vendor/'`
checkdeps:
[ -x "$(GOVENDOR)" ] || $(GO) get -u github.com/kardianos/govendor
govendor list +e | grep '^ e ' && { echo "Found missing packages. Please run 'govendor add +e'"; exit 1; } || : echo
vendorfmt:
[ -x "$(VENDORFMT)" ] || $(GO) get -u github.com/magiconair/vendorfmt/cmd/vendorfmt
vendorfmt
gofmt:
gofmt -s -w `find . -type f -name '*.go' | grep -v vendor`
linux:
GOOS=linux GOARCH=amd64 $(GO) build -i -tags netgo $(GOFLAGS)
install:
$(GO) install $(GOFLAGS)
vet:
$(GO) vet ./...
pkg: build test
rm -rf pkg
mkdir pkg
tar czf pkg/fabio.tar.gz fabio
release: test
build/release.sh
homebrew:
build/homebrew.sh
codeship:
go version
go env
wget -O ~/consul.zip https://releases.hashicorp.com/consul/1.0.0/consul_1.0.0_linux_amd64.zip
wget -O ~/vault.zip https://releases.hashicorp.com/vault/0.8.3/vault_0.8.3_linux_amd64.zip
unzip -o -d ~/bin ~/consul.zip
unzip -o -d ~/bin ~/vault.zip
vault --version
consul --version
cd ~/src/github.com/fabiolb/fabio && make test
fabio-builder: make-fabio-builder push-fabio-builder
make-fabio-builder:
docker build -t fabiolb/fabio-builder --squash build/fabio-builder
push-fabio-builder:
docker push fabiolb/fabio-builder
buildpkg: test
build/build.sh
clean:
$(GO) clean
rm -rf pkg
.PHONY: build buildpkg clean docker gofmt homebrew install linux pkg release test vendorfmt vet