Skip to content

Commit 64ac056

Browse files
committed
build: add Makefile
1 parent 7b9ba9f commit 64ac056

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
REGISTRY_NAME=ponyai-registry-vpc.cn-shenzhen.cr.aliyuncs.com/ponyai-vd-infra-platform
2+
GIT_COMMIT=$(shell git rev-parse "HEAD^{commit}")
3+
ifndef VERSION
4+
VERSION=$(shell git describe --tags --match='v*' --dirty 2>/dev/null || git rev-list -n1 HEAD)
5+
endif
6+
CMDS=build
7+
all: build
8+
9+
build:
10+
GOOS=linux CGO_ENABLED=0 go build -o ./bin/draino ./cmd/draino
11+
12+
image: build
13+
docker build -f ./Dockerfile -t $(REGISTRY_NAME)/draino:$(VERSION) ./
14+
15+
push: image
16+
docker push $(REGISTRY_NAME)/draino:$(VERSION)
17+
18+
push-test: build
19+
docker build -f ./Dockerfile -t $(REGISTRY_NAME)/draino:latest ./
20+
docker push $(REGISTRY_NAME)/draino:latest
21+
clean:
22+
rm -rf ./bin

0 commit comments

Comments
 (0)