-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 1.15 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
TARGET=./build/bin/titond
.PHONY: all run build titond image image-amd image-arm clean test check
all: run
run: $(TARGET)
$<
$(TARGET): build
check:
swag init -g cmd/titond/main.go -o api
CGO_ENABLED=0 GOOS=linux go build -o ./build/bin/titond ./cmd/titond/main.go
./build/bin/titond check-swagger
build:
swag init -g cmd/titond/main.go -o api
CGO_ENABLED=0 GOOS=linux go build -o ./build/bin/titond ./cmd/titond/main.go
@echo "Done building"
@echo "Run \"./build/bin/titond\" to launch titond backend."
titond:
swag init -g cmd/titond/main.go -o api
CGO_ENABLED=0 GOOS=linux go build -o ./build/bin/titond ./cmd/titond/main.go
@echo "Done building"
@echo "Run \"./build/bin/titond\" to launch titond backend."
image:
docker build --build-arg TARGETOS=linux -t titond-backend .
image-amd:
docker build --build-arg TARGETARCH=amd64 --build-arg TARGETOS=linux -t titond-backend .
image-arm:
docker build --build-arg TARGETARCH=arm64 --build-arg TARGETOS=linux -t titond-backend .
test:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
./scripts/check_coverage_unittest.sh
clean:
rm -rf $(TARGET)
rm -rf docs