-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (54 loc) · 2.12 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
# Makefile
GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/bin
.PHONY: help
all: help
# .PHONY: dev
# dev:
# docker compose -f ./example/compose.yaml up --remove-orphans
.PHONY: dist-test
dist-test:
golangci-lint run ./...
goreleaser --snapshot --clean --skip=publish
.PHONY: test
test:
golangci-lint run ./...
go test -coverprofile=coverage.out -cover ./... && go tool cover -html=coverage.out -o coverage.html
.PHONY: docs
docs:
go run $(GOBASE) docs
.PHONY: run
run:
go run $(GOBASE) -e "teste1=true,teste2=false" -f ./examples/multiple-templates/envFile.yaml --template-path examples/multiple-templates/templates --log-level debug --output-path ./examples/multiple-templates/outputs
.PHONY: run-test
run-test:
@echo
@echo Cleaning up the outputs.
rm -rf ./examples/complete/outputs ./examples/summary/outputs
@echo Complete File testing
go run $(GOBASE) -f examples/complete/envFile.yaml --template-path examples/complete/templates --output-path examples/complete/outputs --log-level debug
@echo
@echo Summary Files testing
go run $(GOBASE) -f examples/summary/envFile.yaml --template-path ./.github/workflows/templates --output-path examples/summary/outputs --log-level debug
.PHONY: build
build:
golangci-lint run
go build -v -ldflags="-X 'main.Version=v0.1.0-beta' -X 'main.commit=$(shell git rev-parse --short HEAD)' -X 'main.builtBy=$(shell id -u -n)' -X 'main.date=$(shell date)'" $(GOBASE)
.PHONY: version
version:
go run -ldflags="-X 'main.version=v0.1.0-beta' -X 'main.commit=$(shell git rev-parse --short HEAD)' -X 'main.builtBy=$(shell id -u -n)' -X 'main.date=$(shell date)'" $(GOBASE) version
@echo
go run -ldflags="-X 'main.version=v0.1.0-beta' -X 'main.commit=$(shell git rev-parse --short HEAD)' -X 'main.builtBy=$(shell id -u -n)' -X 'main.date=$(shell date)'" $(GOBASE) -v
.PHONY: help
help: Makefile
@echo
@echo "Usage: make [options]"
@echo
@echo "Options:"
@echo " build Create binary file"
@echo " run Run GoModeler"
@echo " run-test Run GoModeler"
@echo " dist-test Run GoModeler"
@echo " docs Run GoModeler"
@echo " version Set version in go application"
@echo " Help "