-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (47 loc) · 1.23 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ifneq (,$(wildcard ./.env))
include .env
export
ENV_FILE_PARAM=--env-file .env
endif
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
HASH := $(shell git rev-parse HEAD)
LOCALKUBE := "true"
get:
go get -t -v
go get github.com/joho/godotenv/cmd/godotenv # This lets you run godotenv from the cli
npm install
.PHONY: get
test-ci:
go test -covermode=count -coverprofile=coverage.out ./...
.PHONY: test
build:
go build -v ./...
.PHONY: build
lint:
golangci-lint run -v
.PHONY: lint
test:
$(HOME)/go/bin/gotest -coverprofile=cover.out ./...
.PHONY: test
cover:
go tool cover -html=cover.out
.PHONY: cover
run:
npm run serve &
if go run . ; then \
echo "API graceful exit" ; \
else \
echo "API threw an error, killing Vue process if it was running" ; \
pgrep -f "$(pwd).*vue-cli" | xargs kill ; \
fi
.PHONY: run
fmt:
gofmt -s -w .
.PHONY: fmt
docker-build:
test $(VERSION) # Require VERSION to be specified: make docker-build VERSION=v1.0
DOCKER_CONTENT_TRUST=1 && docker build -f Dockerfile -t asanaban -t asanaban:${VERSION} --build-arg VERSION=${VERSION} --build-arg COMMIT=${HASH} .
.PHONY: docker-build
docker-run:
docker run --rm -p ${HTTP_PORT}:${HTTP_PORT} $(ENV_FILE_PARAM) asanaban:latest
.PHONY: docker-run