-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 865 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 865 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
.PHONY: build build-linux run build-image-linux build-image-arm deploy test docs
IMAGE_NAME := approved-api
IMAGE_TAG := latest
build:
@go build -o bin/approved cmd/main.go
build-linux:
@CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bin/approved cmd/main.go
docs:
swag init -g cmd/main.go
run: build
@./bin/approved
run-dev: docs build
@go run cmd/main.go
build-image-linux: build-linux docs
echo "Building ${IMAGE_NAME}:${IMAGE_TAG} image...";
docker build -f Dockerfile -t ${IMAGE_NAME}:${IMAGE_TAG} .;
echo "Image ${IMAGE_NAME}:${IMAGE_TAG} built.";
build-image-arm: build docs
echo "Building ${IMAGE_NAME}:${IMAGE_TAG} image...";
docker build -f arm.Dockerfile -t ${IMAGE_NAME}:${IMAGE_TAG} .;
echo "Image ${IMAGE_NAME}:${IMAGE_TAG} built.";
deploy:
echo "Running docker compose"
docker compose up -d
test:
@go test -v ./...