Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@

IMAGE_NAME = quay.io/k8scsi/mock-driver
IMAGE_VERSION = canary
APP := ./bin/mock


ifdef V
TESTARGS = -v -args -alsologtostderr -v 5
else
TESTARGS =
endif

all: mock
all: $(APP)

mock:
$(APP):
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./bin/mock ./mock/main.go
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o $(APP) ./mock/main.go

clean:
rm -rf bin

container: mock
container: $(APP)
docker build -f Dockerfile.mock -t $(IMAGE_NAME):$(IMAGE_VERSION) .

push: container
docker push $(IMAGE_NAME):$(IMAGE_VERSION)

.PHONY: all clean container push