k3s/test/images/porter/Makefile

34 lines
980 B
Makefile
Raw Normal View History

2015-06-11 22:55:02 +00:00
# Use:
#
# `make porter` will build porter.
# `make tag` will suggest a tag.
# `make image` will build an image-- you must supply a tag.
# `make push` will push the image-- you must supply a tag.
2015-06-11 22:55:02 +00:00
# This image does not tag in the normal way
# TAG =
PREFIX = gcr.io/google_containers
2015-10-02 02:31:02 +00:00
SUGGESTED_TAG = $(shell git rev-parse --verify HEAD)
2015-06-11 22:55:02 +00:00
porter: porter.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./porter.go
2015-10-02 02:31:02 +00:00
tag:
@echo "If all relevant changes are committed, suggest using TAG=$(SUGGESTED_TAG)"
@echo "$$ make container TAG=$(SUGGESTED_TAG)"
2015-06-11 22:55:02 +00:00
@echo "or"
2015-10-02 02:31:02 +00:00
@echo "$$ make push TAG=$(SUGGESTED_TAG)"
2015-06-11 22:55:02 +00:00
container: image
image:
2015-10-02 02:31:02 +00:00
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
docker build -t $(PREFIX)/porter:$(TAG) .
2015-06-11 22:55:02 +00:00
push:
2015-10-02 02:31:02 +00:00
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
gcloud docker push $(PREFIX)/porter:$(TAG)
2015-06-11 22:55:02 +00:00
clean:
rm -f porter