-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (31 loc) · 889 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
38
39
40
41
42
43
44
include .env
export $(shell sed 's/=.*//' .env)
all: test
test:
go test -v ./...
generate:
golem generate
build: generate
go build
install: build
go install
server: generate
go run main.go server
deps:
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/dashotv/golem@latest
docker:
docker build -t tower-test .
docker-run:
docker run --rm --name tower-test -p 19000:9000 tower
# this works on linux, for mac you use host.docker.internal
# DOCKER_HOST := `/sbin/ifconfig docker0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
# to allow docker to talk to localhost mongo
# $ docker run -it my_application --add-host 'DOCKER_HOST:$DOCKER_HOST'
dotenv:
npx @dotenvx/dotenvx encrypt
check-env:
ifndef TEST_MONGODB_URL
$(error TEST_MONGODB_URL is undefined)
endif
.PHONY: test generate build install server deps docker docker-run check-env