Skip to content

Commit

Permalink
Added gcr.io push to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
davidz627 committed Jan 10, 2018
1 parent 951f0e3 commit 2654970
Showing 1 changed file with 22 additions and 4 deletions.
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

0 comments on commit 2654970

Please sign in to comment.