-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (36 loc) · 1.05 KB
/
Makefile
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
43
44
45
46
PROGRAM:=ptrp
SRC:=$(shell find ./cmd -name \*.go)
ARCH:=$(shell /bin/bash -c "podman version --format '{{ .Client.OsArch }}' | grep -o '[^/]*$$'")
OUT_DIR:=_output
GOFLAGS:=
DOCKERFILE:=Dockerfile.cs8
REGISTRY:=quay.io
ORG:=openshift-psap
TAG:=micro
IMAGE:=$(REGISTRY)/$(ORG)/pts:$(TAG)
AUTHFILE:=$(HOME)/.docker/config-quay.json
NOCACHE:=--no-cache
# Multiple test suites are separated by spaces accepted (e.g. "local/micro local/single-threaded-mini").
PTS_TEST_SUITE:=local/micro
build: $(PROGRAM)
$(PROGRAM): $(SRC)
GOFLAGS=$(GOFLAGS) go build -o $(OUT_DIR)/$(PROGRAM) $^
static: $(SRC)
GOFLAGS=$(GOFLAGS) CGO_ENABLED=0 go build -o $(OUT_DIR)/$(PROGRAM) -a -installsuffix cgo -ldflags '-s' $^
fmt format: $(SRC)
go fmt $^
vet: $(SRC)
go vet $^
strip:
strip $(PROGRAM)
clean:
go clean
rm -rf $(OUT_DIR)
image: $(DOCKERFILE)
podman build $(NOCACHE) \
--arch=$(ARCH) \
--build-arg=ARCH="$(ARCH)" \
--build-arg=PTS_TEST_SUITE="$(PTS_TEST_SUITE)" \
-f $(DOCKERFILE) -t $(IMAGE) .
image-push push:
podman push --authfile $(AUTHFILE) $(IMAGE)