generated from ydataai/go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (24 loc) · 935 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
-include .env
# export $(shell sed 's/=.*//' .env)
GOPATH=$(shell go env GOPATH)
.PHONY: help build fmt vet test
help: # The following lines will print the available commands when entering just 'make'. ⚠️ This needs to be the first target, ever
ifeq ($(UNAME), Linux)
@grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
else
@awk -F ':.*###' '$$0 ~ FS {printf "%15s%s\n", $$1 ":", $$2}' \
$(MAKEFILE_LIST) | grep -v '@awk' | sort
endif
build: ### Build
go build -o main -a cmd/main.go
fmt: ### Run go fmt against code
go fmt ./...
vet: ### Run go vet against code
go vet ./...
test: ### Runs application's tests in verbose mode
go test -v ./...
docker-build: ### Build docker image
docker build -t $(base)authentication-service:$(tag) .
docker-push: ### Build docker image
docker push $(base)authentication-service:$(tag)