forked from terraform-docs/terraform-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 1.23 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
NAME := terraform-docs
VENDOR := segmentio
DESCRIPTION := Generate docs from Terraform modules
MAINTAINER := Martin Etmajer <[email protected]>
URL := https://github.com/$(VENDOR)/$(NAME)
LICENSE := MIT
VERSION := $(shell cat ./VERSION)
GOBUILD := go build -ldflags "-X main.version=$(VERSION)"
GOPKGS := $(shell go list ./... | grep -v /vendor)
.PHONY: all
all: clean deps lint test build
.PHONY: authors
authors:
git log --all --format='%aN <%aE>' | sort -u | egrep -v noreply > AUTHORS
.PHONY: build
build: authors build-darwin-amd64 build-freebsd-amd64 build-linux-amd64 build-windows-amd64
build-darwin-amd64:
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o bin/darwin-amd64/$(NAME)
build-freebsd-amd64:
GOOS=freebsd GOARCH=amd64 $(GOBUILD) -o bin/freebsd-amd64/$(NAME)
build-linux-amd64:
GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/linux-amd64/$(NAME)
build-windows-amd64:
GOOS=windows GOARCH=amd64 $(GOBUILD) -o bin/windows-amd64/$(NAME).exe
.PHONY: clean
clean:
rm -rf ./bin
.PHONY: lint
lint:
gometalinter --config gometalinter.json ./...
.PHONY: deps
deps:
dep ensure
.PHONY: release
release:
git tag -a v$(VERSION) -m v$(VERSION)
git push --tags
.PHONY: test
test:
go test -v $(GOPKGS)