Skip to content

Commit

Permalink
build: add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
xiansonwu committed Dec 4, 2024
1 parent 7b9ba9f commit 64ac056
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
REGISTRY_NAME=ponyai-registry-vpc.cn-shenzhen.cr.aliyuncs.com/ponyai-vd-infra-platform
GIT_COMMIT=$(shell git rev-parse "HEAD^{commit}")
ifndef VERSION
VERSION=$(shell git describe --tags --match='v*' --dirty 2>/dev/null || git rev-list -n1 HEAD)
endif
CMDS=build
all: build

build:
GOOS=linux CGO_ENABLED=0 go build -o ./bin/draino ./cmd/draino

image: build
docker build -f ./Dockerfile -t $(REGISTRY_NAME)/draino:$(VERSION) ./

push: image
docker push $(REGISTRY_NAME)/draino:$(VERSION)

push-test: build
docker build -f ./Dockerfile -t $(REGISTRY_NAME)/draino:latest ./
docker push $(REGISTRY_NAME)/draino:latest
clean:
rm -rf ./bin

0 comments on commit 64ac056

Please sign in to comment.