k3s/test/images/porter/Makefile

30 lines
920 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 container` will build a container-- you must supply a tag.
# `make push` will push the container-- you must supply a tag.
REPO ?= 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:
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))
2015-06-11 22:55:02 +00:00
docker build -t $(REPO)/porter:$(TAG) .
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))
2015-06-18 19:18:53 +00:00
gcloud docker push $(REPO)/porter:$(TAG)
2015-06-11 22:55:02 +00:00
clean:
rm -f porter