forked from vinyldns/go-vinyldns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (48 loc) · 1.44 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
VERSION=0.9.16
SOURCE?=./...
VINYLDNS_REPO=github.com/vinyldns/vinyldns
VINYLDNS_DIR="$(GOPATH)/src/$(VINYLDNS_REPO)/"
VINYLDNS_VERSION=latest
ifndef $(GOPATH)
GOPATH=$(shell go env GOPATH)
export GOPATH
endif
all: check-fmt test build integration stop-api validate-version install
fmt:
gofmt -s -w vinyldns
check-fmt:
test -z "$(shell gofmt -s -l vinyldns | tee /dev/stderr)"
test:
go vet $(SOURCE)
GO111MODULE=on go test $(SOURCE) -cover
integration: start-api
GO111MODULE=on go test $(SOURCE) -tags=integration
validate-version:
cat vinyldns/version.go | grep 'var Version = "$(VERSION)"'
clone-vinyl:
if [ ! -d $(VINYLDNS_DIR) ]; then \
echo "$(VINYLDNS_REPO) not found in your GOPATH (necessary for acceptance tests), getting..."; \
git clone \
https://$(VINYLDNS_REPO) \
$(VINYLDNS_DIR); \
else \
git -C $(VINYLDNS_DIR) pull ; \
fi
start-api: clone-vinyl stop-api
$(GOPATH)/src/$(VINYLDNS_REPO)/quickstart/quickstart-vinyldns.sh \
--api --version-tag $(VINYLDNS_VERSION)
stop-api:
$(GOPATH)/src/$(VINYLDNS_REPO)/quickstart/quickstart-vinyldns.sh \
--clean
build:
GO111MODULE=on go build -ldflags "-X main.version=$(VERSION)" $(SOURCE)
install:
GO111MODULE=on go install $(SOURCE)
release: test validate-version
go get github.com/aktau/github-release
github-release release \
--user vinyldns \
--repo go-vinyldns \
--tag $(VERSION) \
--name "$(VERSION)" \
--description "go-vinyldns version $(VERSION)"