-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
37 lines (28 loc) · 805 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
GIT_CURRENT_BRANCH := ${shell git symbolic-ref --short HEAD}
start:
docker-compose up -d
stop:
docker-compose down
export_envs:
export $(cat .env-sample | xargs)
build:
go build -o api cmd/api/main.go
run:
go run cmd/api/main.go
doc:
swag init -g cmd/api/main.go
test:
@echo "Input Package Name (Ex: pkg/utils)"
@read INPUT_PKG; go test -v -race -cover "github.com/felipeagger/go-boilerplate/$$INPUT_PKG"
tests:
@go test -v -race -cover -covermode=atomic -coverprofile=coverage.out ./...
release:
@if [ "$(v)" == "" ]; then \
echo "You need to specify the new release version. Ex: make release v=1.0.0"; \
exit 1; \
fi
@echo "Creating a new release tag version: ${v}"
@git tag ${v}
@git push origin ${v}
@git push --set-upstream origin "${GIT_CURRENT_BRANCH}"
@git push origin