-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 785 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) · 785 Bytes
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
EXECUTABLE := dockyard
GITVERSION := $(shell git describe --dirty --always --tags --long 2>/dev/null || echo "dev")
PACKAGENAME := $(shell go list -m -f '{{.Path}}')
.PHONY: default
default: ${EXECUTABLE}
.PHONY: ${EXECUTABLE}
${EXECUTABLE}:
mkdir -p build
go build -ldflags "-X ${PACKAGENAME}/internal/version.Executable=${EXECUTABLE} -X ${PACKAGENAME}/internal/version.GitVersion=${GITVERSION}" -o build/${EXECUTABLE}
.PHONY: run
run: ${EXECUTABLE}
./build/${EXECUTABLE} server -c config.yaml
.PHONY: test
test:
go test -cover ./...
.PHONY: clean
clean:
rm -rf build/
.PHONY: docker
docker:
docker build -t ${EXECUTABLE} .
.PHONY: docker-up
docker-up:
docker compose up --build -d
.PHONY: docker-down
docker-down:
docker compose down
.PHONY: tidy
tidy:
go mod tidy