From 70e4693428565404a90bc52f2f692808fd9d535e Mon Sep 17 00:00:00 2001 From: Steve Milner Date: Mon, 26 Oct 2015 15:22:06 -0400 Subject: [PATCH] Standardized test image Makefile targets --- test/images/dnsutils/Makefile | 15 ++++++++++----- test/images/entrypoint-tester/Makefile | 9 +++++---- test/images/goproxy/Makefile | 9 +++++---- test/images/jessie-dnsutils/Makefile | 15 ++++++++++----- test/images/mount-tester-user/Makefile | 11 +++++++---- test/images/mount-tester/Makefile | 9 +++++---- test/images/network-tester/Makefile | 16 +++++++++------- test/images/port-forward-tester/Makefile | 9 +++++---- test/images/porter/Makefile | 16 ++++++++++------ test/images/resource-consumer/Makefile | 16 +++++++++++----- test/images/volumes-tester/ceph/Makefile | 17 ++++++++++------- test/images/volumes-tester/gluster/Makefile | 17 ++++++++++------- test/images/volumes-tester/iscsi/Makefile | 19 ++++++++++++------- test/images/volumes-tester/nfs/Makefile | 17 ++++++++++------- test/images/volumes-tester/rbd/Makefile | 19 ++++++++++++------- 15 files changed, 131 insertions(+), 83 deletions(-) diff --git a/test/images/dnsutils/Makefile b/test/images/dnsutils/Makefile index 3c871286d2..a7bcc92b75 100644 --- a/test/images/dnsutils/Makefile +++ b/test/images/dnsutils/Makefile @@ -1,8 +1,13 @@ -all: - @echo "try 'make image' or 'make push'" +# This image does not tag +#TAG = +PREFIX = gcr.io/google_containers + +all: push image: - docker build -t gcr.io/google_containers/dnsutils . + docker build -t $(PREFIX)/dnsutils . -push: - gcloud docker push gcr.io/google_containers/dnsutils +push: image + gcloud docker push $(PREFIX)/dnsutils + +clean: diff --git a/test/images/entrypoint-tester/Makefile b/test/images/entrypoint-tester/Makefile index b9671709c2..c230b89e4a 100644 --- a/test/images/entrypoint-tester/Makefile +++ b/test/images/entrypoint-tester/Makefile @@ -1,15 +1,16 @@ -all: push - TAG = 0.1 +PREFIX = kubernetes + +all: push ep: ep.go CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./ep.go image: ep - sudo docker build -t kubernetes/eptest:$(TAG) . + sudo docker build -t $(PREFIX)/eptest:$(TAG) . push: image - sudo docker push kubernetes/eptest:$(TAG) + sudo docker push $(PREFIX)/eptest:$(TAG) clean: rm -f ep diff --git a/test/images/goproxy/Makefile b/test/images/goproxy/Makefile index 2f496ee798..9802be8f3f 100644 --- a/test/images/goproxy/Makefile +++ b/test/images/goproxy/Makefile @@ -1,15 +1,16 @@ -all: push - TAG = 0.1 +PREFIX = gcr.io/google_containers + +all: push goproxy: goproxy.go CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./goproxy.go image: goproxy - docker build -t gcr.io/google_containers/goproxy:$(TAG) . + docker build -t $(PREFIX)/goproxy:$(TAG) . push: image - gcloud docker push gcr.io/google_containers/goproxy:$(TAG) + gcloud docker push $(PREFIX)/goproxy:$(TAG) clean: rm -f goproxy diff --git a/test/images/jessie-dnsutils/Makefile b/test/images/jessie-dnsutils/Makefile index 450e9dd86d..406b2c821e 100644 --- a/test/images/jessie-dnsutils/Makefile +++ b/test/images/jessie-dnsutils/Makefile @@ -1,8 +1,13 @@ -all: - @echo "try 'make image' or 'make push'" +# This image does not tag +#TAG = +PREFIX = gcr.io/google_containers + +all: push image: - docker build -t gcr.io/google_containers/jessie-dnsutils . + docker build -t $(PREFIX)/jessie-dnsutils . -push: - gcloud docker push gcr.io/google_containers/jessie-dnsutils +push: image + gcloud docker push $(PREFIX)/jessie-dnsutils + +clean: diff --git a/test/images/mount-tester-user/Makefile b/test/images/mount-tester-user/Makefile index 5600d1815a..1288881bf3 100644 --- a/test/images/mount-tester-user/Makefile +++ b/test/images/mount-tester-user/Makefile @@ -1,9 +1,12 @@ +TAG = 0.3 +PREFIX = gcr.io/google_containers + all: push -TAG = 0.3 - image: - sudo docker build -t gcr.io/google_containers/mounttest-user:$(TAG) . + sudo docker build -t $(PREFIX)/mounttest-user:$(TAG) . push: image - gcloud docker push gcr.io/google_containers/mounttest-user:$(TAG) + gcloud docker push $(PREFIX)/mounttest-user:$(TAG) + +clean: diff --git a/test/images/mount-tester/Makefile b/test/images/mount-tester/Makefile index 9985c8557b..81ff72310d 100644 --- a/test/images/mount-tester/Makefile +++ b/test/images/mount-tester/Makefile @@ -1,15 +1,16 @@ -all: push - TAG = 0.5 +PREFIX = gcr.io/google_containers + +all: push mt: mt.go CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./mt.go image: mt - sudo docker build -t gcr.io/google_containers/mounttest:$(TAG) . + sudo docker build -t $(PREFIX)/mounttest:$(TAG) . push: image - gcloud docker push gcr.io/google_containers/mounttest:$(TAG) + gcloud docker push $(PREFIX)/mounttest:$(TAG) clean: rm -f mt diff --git a/test/images/network-tester/Makefile b/test/images/network-tester/Makefile index 4b919a7ff1..9e8e56fed1 100644 --- a/test/images/network-tester/Makefile +++ b/test/images/network-tester/Makefile @@ -1,16 +1,18 @@ -all: push - -# Set this to the *next* version to prevent accidentally overwriting the existing image. TAG = 1.6 +PREFIX = gcr.io/google_containers + +all: push webserver: webserver.go CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./webserver.go -container: webserver - docker build -t gcr.io/google_containers/nettest:$(TAG) . +container: image -push: container - gcloud docker push gcr.io/google_containers/nettest:$(TAG) +image: webserver + docker build -t $(PREFIX)/nettest:$(TAG) . + +push: image + gcloud docker push $(PREFIX)/nettest:$(TAG) clean: rm -f webserver diff --git a/test/images/port-forward-tester/Makefile b/test/images/port-forward-tester/Makefile index be0d3a21eb..0e0aaf1d32 100644 --- a/test/images/port-forward-tester/Makefile +++ b/test/images/port-forward-tester/Makefile @@ -1,15 +1,16 @@ -all: push - TAG = 1.0 +PREFIX = gcr.io/google_containers + +all: push portforwardtester: portforwardtester.go CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./portforwardtester.go image: portforwardtester - docker build -t gcr.io/google_containers/portforwardtester:$(TAG) . + docker build -t $(PREFIX)/portforwardtester:$(TAG) . push: image - gcloud docker push gcr.io/google_containers/portforwardtester:$(TAG) + gcloud docker push $(PREFIX)/portforwardtester:$(TAG) clean: rm -f portforwardtester diff --git a/test/images/porter/Makefile b/test/images/porter/Makefile index 99cef22dda..54ac6f8aac 100644 --- a/test/images/porter/Makefile +++ b/test/images/porter/Makefile @@ -2,10 +2,12 @@ # # `make porter` will build porter. # `make tag` will suggest a tag. -# `make container` will build a container-- you must supply a tag. -# `make push` will push the container-- you must supply a tag. +# `make image` will build an image-- you must supply a tag. +# `make push` will push the image-- you must supply a tag. -REPO ?= gcr.io/google_containers +# This image does not tag in the normal way +# TAG = +PREFIX = gcr.io/google_containers SUGGESTED_TAG = $(shell git rev-parse --verify HEAD) porter: porter.go @@ -17,13 +19,15 @@ tag: @echo "or" @echo "$$ make push TAG=$(SUGGESTED_TAG)" -container: +container: image + +image: $(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion)) - docker build -t $(REPO)/porter:$(TAG) . + docker build -t $(PREFIX)/porter:$(TAG) . push: $(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion)) - gcloud docker push $(REPO)/porter:$(TAG) + gcloud docker push $(PREFIX)/porter:$(TAG) clean: rm -f porter diff --git a/test/images/resource-consumer/Makefile b/test/images/resource-consumer/Makefile index 9d1ea6237f..8b7e92fc94 100644 --- a/test/images/resource-consumer/Makefile +++ b/test/images/resource-consumer/Makefile @@ -1,16 +1,22 @@ -all: clean consumer - TAG = beta +PREFIX = gcr.io/google_containers + +all: clean consumer consumer: CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consumer . -container: - sudo docker build -t gcr.io/google_containers/resource_consumer:$(TAG) . +container: image + +image: + sudo docker build -t $(PREFIX)/resource_consumer:$(TAG) . run_container: - docker run --publish=8080:8080 gcr.io/google_containers/resource_consumer:$(TAG) + docker run --publish=8080:8080 $(PREFIX)/resource_consumer:$(TAG) + +push: + @echo "This image is not meant to be pushed." clean: rm -f consumer diff --git a/test/images/volumes-tester/ceph/Makefile b/test/images/volumes-tester/ceph/Makefile index 58950e7753..52233381ec 100644 --- a/test/images/volumes-tester/ceph/Makefile +++ b/test/images/volumes-tester/ceph/Makefile @@ -1,13 +1,16 @@ +TAG = 0.1 +PREFIX = gcr.io/google_containers + all: push -TAG = 0.1 +container: image -container: - docker build -t gcr.io/google_containers/volume-ceph . # Build new image and automatically tag it as latest - docker tag gcr.io/google_containers/volume-ceph gcr.io/google_containers/volume-ceph:$(TAG) # Add the version tag to the latest image +image: + docker build -t $(PREFIX)/volume-ceph . # Build new image and automatically tag it as latest + docker tag $(PREFIX)/volume-ceph $(PREFIX)/volume-ceph:$(TAG) # Add the version tag to the latest image -push: container - gcloud docker push gcr.io/google_containers/volume-ceph # Push image tagged as latest to repository - gcloud docker push gcr.io/google_containers/volume-ceph:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) +push: image + gcloud docker push $(PREFIX)/volume-ceph # Push image tagged as latest to repository + gcloud docker push $(PREFIX)/volume-ceph:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) clean: diff --git a/test/images/volumes-tester/gluster/Makefile b/test/images/volumes-tester/gluster/Makefile index b52ce19dec..def3c729ef 100644 --- a/test/images/volumes-tester/gluster/Makefile +++ b/test/images/volumes-tester/gluster/Makefile @@ -1,13 +1,16 @@ +TAG = 0.2 +PREFIX = gcr.io/google_containers + all: push -TAG = 0.2 +container: image -container: - docker build -t gcr.io/google_containers/volume-gluster . # Build new image and automatically tag it as latest - docker tag gcr.io/google_containers/volume-gluster gcr.io/google_containers/volume-gluster:$(TAG) # Add the version tag to the latest image +image: + docker build -t $(PREFIX)/volume-gluster . # Build new image and automatically tag it as latest + docker tag $(PREFIX)/volume-gluster $(PREFIX)/volume-gluster:$(TAG) # Add the version tag to the latest image -push: container - gcloud docker push gcr.io/google_containers/volume-gluster # Push image tagged as latest to repository - gcloud docker push gcr.io/google_containers/volume-gluster:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) +push: image + gcloud docker push $(PREFIX)/volume-gluster # Push image tagged as latest to repository + gcloud docker push $(PREFIX)/volume-gluster:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) clean: diff --git a/test/images/volumes-tester/iscsi/Makefile b/test/images/volumes-tester/iscsi/Makefile index 93119cdc77..473904c318 100644 --- a/test/images/volumes-tester/iscsi/Makefile +++ b/test/images/volumes-tester/iscsi/Makefile @@ -1,12 +1,15 @@ +TAG = 0.1 +PREFIX = gcr.io/google_containers + all: push -TAG = 0.1 +container: image -container: +image: # Build new image and automatically tag it as latest - docker build -t gcr.io/google_containers/volume-iscsi . + docker build -t $(PREFIX)/volume-iscsi . # Add the version tag to the latest image - docker tag gcr.io/google_containers/volume-iscsi gcr.io/google_containers/volume-iscsi:$(TAG) + docker tag $(PREFIX)/volume-iscsi $(PREFIX)/volume-iscsi:$(TAG) block: # Create block.tar.gz with ext2 block device with index.html inside. @@ -15,8 +18,10 @@ block: # Run as root! ./create_block.sh -push: container +push: image # Push image tagged as latest to repository - gcloud docker push gcr.io/google_containers/volume-iscsi + gcloud docker push $(PREFIX)/volume-iscsi # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) - gcloud docker push gcr.io/google_containers/volume-iscsi:$(TAG) + gcloud docker push $(PREFIX)/volume-iscsi:$(TAG) + +clean: diff --git a/test/images/volumes-tester/nfs/Makefile b/test/images/volumes-tester/nfs/Makefile index a70fb7902f..de9fbb2b83 100644 --- a/test/images/volumes-tester/nfs/Makefile +++ b/test/images/volumes-tester/nfs/Makefile @@ -1,13 +1,16 @@ +TAG = 0.4 +PREFIX = gcr.io/google_containers + all: push -TAG = 0.4 +container: image -container: - docker build -t gcr.io/google_containers/volume-nfs . # Build new image and automatically tag it as latest - docker tag gcr.io/google_containers/volume-nfs gcr.io/google_containers/volume-nfs:$(TAG) # Add the version tag to the latest image +image: + docker build -t $(PREFIX)/volume-nfs . # Build new image and automatically tag it as latest + docker tag $(PREFIX)/volume-nfs $(PREFIX)/volume-nfs:$(TAG) # Add the version tag to the latest image -push: container - gcloud docker push gcr.io/google_containers/volume-nfs # Push image tagged as latest to repository - gcloud docker push gcr.io/google_containers/volume-nfs:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) +push: image + gcloud docker push $(PREFIX)/volume-nfs # Push image tagged as latest to repository + gcloud docker push $(PREFIX)/volume-nfs:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) clean: diff --git a/test/images/volumes-tester/rbd/Makefile b/test/images/volumes-tester/rbd/Makefile index a1d1e16882..62f08b363f 100644 --- a/test/images/volumes-tester/rbd/Makefile +++ b/test/images/volumes-tester/rbd/Makefile @@ -1,12 +1,15 @@ +TAG = 0.1 +PREFIX = gcr.io/google_containers + all: push -TAG = 0.1 +container: image -container: +image: # Build new image and automatically tag it as latest - docker build -t gcr.io/google_containers/volume-rbd . + docker build -t $(PREFIX)/volume-rbd . # Add the version tag to the latest image - docker tag gcr.io/google_containers/volume-rbd gcr.io/google_containers/volume-rbd:$(TAG) + docker tag $(PREFIX)/volume-rbd $(PREFIX)/volume-rbd:$(TAG) block: # Create block.tar.gz with ext2 block device with index.html inside. @@ -15,8 +18,10 @@ block: # Run as root! ./create_block.sh -push: container +push: image # Push image tagged as latest to repository - gcloud docker push gcr.io/google_containers/volume-rbd + gcloud docker push $(PREFIX)/volume-rbd # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag) - gcloud docker push gcr.io/google_containers/volume-rbd:$(TAG) + gcloud docker push $(PREFIX)/volume-rbd:$(TAG) + +clean: