~evanj/cms

ref: 356e3f389fe3e9167cffb270f41b6f2b22eb202a cms/makefile -rw-r--r-- 763 bytes
356e3f38Evan J Feat(context): Completed adding context to data layer. Refactored tests 1 year, 20 days ago
                                                                                
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
BIN=cms
ENV=`cat .env`
VER=`git rev-parse HEAD`

all: setup vendor gen build

setup:
	@go get git.sr.ht/~evanj/embed/cmd/embed
	@go get github.com/golang/mock/mockgen

vendor: go.mod go.sum
	@go mod tidy
	@go mod vendor

build:
	@echo $(VER) | xargs -I {} go build -ldflags='-s -w -X main.build={}' -o $(BIN)

gen: 
	@go generate ./...

test: 
	@env $(ENV) go test ./... -count 1

coverage: 
	@env $(ENV) go test ./... -cover -coverprofile=coverage.out ; go tool cover -html=coverage.out

lint: 
	@find * -not -name '*_embed.go' | grep -E '*.(sql|go|js|css|html)' | entr -cr go vet ./...

run: gen build
	@clear
	@env $(ENV) ./$(BIN)

dev:
	@find * -not -name '*_embed.go' | grep -E '*.(sql|go|js|css|html)' | entr -cr make run