forked from drone/envsubst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 756 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
37
38
39
.PHONY: build
APP_NAME = envsubst
BUILD_DIR = $(PWD)/build
MAIN_FILE = ./cmd/$(APP_NAME)/main.go
dev_dependencies:
asdf install
go get -u github.com/rakyll/gotest
go get -u github.com/gojekfarm/go-coverage
asdf reshim golang
dependencies:
go mod download
go mod tidy
install: dev_dependencies dependencies
clean:
rm -rf $(BUILD_DIR)
lint:
golangci-lint run ./...
test:
gotest -v -timeout 30s -coverprofile=coverage.out -cover ./...
go-coverage -f coverage.out --trim
build: clean
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o $(BUILD_DIR)/$(APP_NAME) $(MAIN_FILE)
run:
go run $(MAIN_FILE)
example_stdin:
go run $(MAIN_FILE) < example-input.tmpl
example_args:
go run $(MAIN_FILE) -no-empty < example-input.tmpl