File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 11.idea /
22.vscode /
3+ bin /
4+ coverage.txt
Original file line number Diff line number Diff line change 1+ GOPATH ?= ${HOME}/go
2+ RACE ?= 0
3+ ENVIRONMENT ?= development
4+ VERSION ?= dev
5+
6+ .PHONY : all
7+ all : clean test build
8+
9+ .PHONY : test
10+ test :
11+ ifeq ($(RACE ) , 1)
12+ go test ./... -race -covermode=atomic -coverprofile=coverage.txt -timeout 5m
13+ else
14+ go test ./... -covermode=atomic -coverprofile=coverage.txt -timeout 1m
15+ endif
16+
17+ .PHONY : build
18+ build :
19+ ifeq ($(ENVIRONMENT ) ,production)
20+ CGO_ENABLED=0 go build -ldflags="-s -w -X 'main.Version=${VERSION}'" -o ./bin/hosts cmd/hosts/main.go
21+ else ifeq ($(ENVIRONMENT),development)
22+ go build -o ./bin/hosts cmd/hosts/main.go
23+ else
24+ echo "Target ${ENVIRONMENT} is not supported"
25+ endif
26+
27+ .PHONY : git-setup
28+ git-setup :
29+ git config user.name GitHub
30+ git config user.email
[email protected] 31+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN} @github.com/malusev998/dusanmalusev.git
32+
33+ .PHONY : commit
34+ commit :
35+ git add .
36+ ifneq ($(shell git status --porcelain) ,)
37+ git commit --author "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" --message "${MESSAGE}"
38+ git push
39+ endif
40+
41+ .PHONY : clean
42+ clean :
43+ rm -rf ./bin
You can’t perform that action at this time.
0 commit comments