-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (32 loc) · 718 Bytes
/
Makefile
File metadata and controls
42 lines (32 loc) · 718 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
36
37
38
39
40
41
42
# The binary to build (just the basename).
BIN ?= velero-plugin-for-jdcloud
# Where to push the docker image.
REGISTRY ?= velero
# Image name
IMAGE ?= $(REGISTRY)/$(BIN)
# Image tag
VERSION ?= latest
# Build arch
ARCH ?= amd64
# Target OS
TargetOS ?= linux
# Build the binary
.PHONY: build
build:
go build -v -o $(BIN) ./velero-plugin-for-jdcloud
# Build the docker image
.PHONY: docker-build
docker-build:
docker build -t $(IMAGE):$(VERSION) --build-arg TARGETOS=$(TargetOS) --build-arg TARGETARCH=$(ARCH) .
# Push the docker image
.PHONY: docker-push
docker-push:
docker push $(IMAGE):$(VERSION)
# Clean build artifacts
.PHONY: clean
clean:
rm -f $(BIN)
# Run tests
.PHONY: test
test:
go test -v ./...