Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gcr.io push to Makefile #20

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 22 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,21 @@

.PHONY: all csi-attacher clean test

IMAGE_NAME=docker.io/k8scsi/csi-attacher
IMAGE_VERSION=latest
GCR_IMAGE_PATH=gcr.io/google-containers/sig-storage/csi/external-attacher
DOCKER_IMAGE_PATH=docker.io/k8scsi/csi-attacher

IMAGE_VERSION :=
TAG := $(shell git describe --abbrev=0 --tags HEAD 2>/dev/null)
COMMIT := $(shell git rev-parse HEAD)
ifeq ($(TAG),)
IMAGE_VERSION := latest
else
ifeq ($(COMMIT), $(shell git rev-list -n1 $(TAG)))
IMAGE_VERSION := $(TAG)
else
IMAGE_VERSION := $(TAG)-$(COMMIT)
endif
endif

ifdef V
TESTARGS = -v -args -alsologtostderr -v 5
Expand All @@ -34,10 +47,15 @@ clean:

container: csi-attacher
cp csi-attacher deploy/docker
docker build -t $(IMAGE_NAME):$(IMAGE_VERSION) deploy/docker
docker build -t $(DOCKER_IMAGE_PATH):$(IMAGE_VERSION) deploy/docker

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

gcr-push: csi-attacher
cp bin/csi-attacher deploy/docker
docker build -t $(GCR_IMAGE_PATH):$(IMAGE_VERSION) deploy/docker
gcloud docker -- push $(GCR_IMAGE_PATH):$(IMAGE_VERSION)

test:
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
Expand Down