-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
41 lines (33 loc) · 1.05 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
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOLIST=$(GOCMD) list
BINARY_NAME=safenotes
PKGS=$(shell ${GOLIST} ./... | grep -v /vendor)
COVERAGEDIR=./dist/coverage
.PHONY: build
build:
CGO_ENABLED=0 $(GOBUILD) -ldflags="-extldflags=-static -X github.com/koderhut/safenotes/pkg/version.Version=${TAG}" -o dist/$(BINARY_NAME) .
.PHONY: release-docker
release-docker:
@if [ ! -f '.safenotes.build.yaml' ]; then echo ">>> Missing .safenotes.build.yaml" && exit 1; fi;
DOCKER_BUILDKIT=1 docker build --target PROD -f build/docker/Dockerfile ${OPTS} --build-arg VERSION=${TAG} --tag ${REPO}:${TAG} .
.PHONY: react-dev
react-dev:
docker-compose --project-directory webapp/react -f webapp/react/docker-compose.yaml up -d
.PHONY: react-sh
react-sh:
docker exec -ti sn-react bash
.PHONY: clean
clean:
rm -rf dist/*
.PHONY: test
test:
@echo "Running tests..."
@$(GOTEST) ${OPTS} $(PKGS)
.PHONY: test-coverage
test-coverage:
@echo "Running test with coverage..."
@$(GOTEST) -json -covermode=atomic -coverpkg=./... $(PKGS)