forked from MR5356/elune-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (20 loc) · 909 Bytes
/
Makefile
File metadata and controls
29 lines (20 loc) · 909 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
NAME = elune-backend
VERSION ?= $(shell git symbolic-ref --short -q HEAD)-$(shell git rev-parse --short HEAD)
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
build: clean deps ## Build the project
go build -ldflags "-s -w" -o bin/$(NAME)
build-bin: deps ## Build binary
go build -ldflags "-s -w" -o bin/$(NAME)-${GOOS}-${GOARCH}
test: deps ## Execute tests
go test ./...
deps: ## Install dependencies using go get
go get -d -v -t ./...
clean: ## Remove building artifacts
rm -rf bin
image: ## Build and push docker image
docker buildx build --platform linux/arm64,linux/amd64 -t registry.cn-hangzhou.aliyuncs.com/toodo/elune-backend:$(VERSION) . --push
deploy: ## Deploy to k8s
helm upgrade --install --wait $(NAME) -n toodo ./charts --set image.tag=$(VERSION)