mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
MUTABLE_VERSION ?= canary
|
|
|
|
GIT_COMMIT := $(shell git rev-parse HEAD)
|
|
GIT_SHA := $(shell git rev-parse --short HEAD)
|
|
GIT_TAG := $(shell git describe --tags --abbrev=0 2>/dev/null)
|
|
|
|
ifdef VERSION
|
|
DOCKER_VERSION = $(VERSION)
|
|
BINARY_VERSION = $(VERSION)
|
|
endif
|
|
|
|
DOCKER_VERSION ?= git-${GIT_SHA}
|
|
BINARY_VERSION ?= ${GIT_TAG}-${GIT_SHA}
|
|
|
|
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${DOCKER_VERSION}
|
|
MUTABLE_IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION}
|
|
|
|
LDFLAGS += -X k8s.io/helm/pkg/version.BuildMetadata=${BINARY_VERSION}
|
|
LDFLAGS += -X k8s.io/helm/pkg/version.GitCommit=${GIT_COMMIT}
|
|
|
|
DOCKER_PUSH = docker push
|
|
ifeq ($(DOCKER_REGISTRY),gcr.io)
|
|
DOCKER_PUSH = gcloud docker push
|
|
endif
|
|
|
|
info:
|
|
@echo "Build tag: ${DOCKER_VERSION}"
|
|
@echo "Registry: ${DOCKER_REGISTRY}"
|
|
@echo "Immutable tag: ${IMAGE}"
|
|
@echo "Mutable tag: ${MUTABLE_IMAGE}"
|
|
|
|
.PHONY: docker-push
|
|
docker-push: docker-mutable-push docker-immutable-push
|
|
|
|
.PHONY: docker-immutable-push
|
|
docker-immutable-push:
|
|
${DOCKER_PUSH} ${IMAGE}
|
|
|
|
.PHONY: docker-mutable-push
|
|
docker-mutable-push:
|
|
${DOCKER_PUSH} ${MUTABLE_IMAGE}
|