Adding fix for release branch latest tag pushing (#1420)

* Adding fix for release branch latest tag pushign

* Updating how we handle pushing latest branches

* Cleaning up and adding CUSTOMTAG where necessary

* Correcting comment on satellite-ui
This commit is contained in:
Philip Hutchins 2019-03-07 10:22:18 -05:00 committed by GitHub
parent e0dd5d224a
commit af0d5add06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,10 +5,12 @@ COMPOSE_PROJECT_NAME := ${TAG}-$(shell git rev-parse --abbrev-ref HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed "s!/!-!g")
ifeq (${BRANCH},master)
TAG := $(shell git rev-parse --short HEAD)-go${GO_VERSION}
TRACKED_BRANCH := true
LATEST_TAG := latest
else
TAG := $(shell git rev-parse --short HEAD)-${BRANCH}-go${GO_VERSION}
ifneq (,$(findstring release-,$(BRANCH)))
TRACKED_BRANCH := true
LATEST_TAG := ${BRANCH}-latest
endif
endif
@ -123,8 +125,8 @@ gateway-image: ## Build gateway Docker image
satellite-image: ## Build satellite Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG} -f cmd/satellite/Dockerfile .
.PHONY: satellite-ui-image
satellite-ui-image: ## Build satellite Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/satellite-ui:${TAG}${CUSTOMTAG} -t storjlabs/satellite-ui:latest -f web/satellite/Dockerfile .
satellite-ui-image: ## Build satellite-ui Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/satellite-ui:${TAG}${CUSTOMTAG} -f web/satellite/Dockerfile .
.PHONY: storagenode-image
storagenode-image: ## Build storagenode Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/storagenode:${TAG}${CUSTOMTAG} -f cmd/storagenode/Dockerfile .
@ -196,18 +198,20 @@ deploy: ## Update Kubernetes deployments in staging (jenkins)
.PHONY: push-images
push-images: ## Push Docker images to Docker Hub (jenkins)
docker tag storjlabs/satellite:${TAG} storjlabs/satellite:latest
docker push storjlabs/satellite:${TAG}
docker push storjlabs/satellite:${TAG}${CUSTOMTAG}
docker push storjlabs/storagenode:${TAG}${CUSTOMTAG}
docker push storjlabs/uplink:${TAG}${CUSTOMTAG}
docker push storjlabs/gateway:${TAG}${CUSTOMTAG}
ifeq (${TRACKED_BRANCH},true)
docker tag storjlabs/satellite:${TAG}${CUSTOMTAG} storjlabs/satellite:${LATEST_TAG}
docker push storjlabs/satellite:${LATEST_TAG}
docker tag storjlabs/storagenode:${TAG} storjlabs/storagenode:latest
docker push storjlabs/storagenode:${TAG}
docker tag storjlabs/satellite:${TAG}${CUSTOMTAG} storjlabs/storagenode:${LATEST_TAG}
docker push storjlabs/storagenode:${LATEST_TAG}
docker tag storjlabs/uplink:${TAG} storjlabs/uplink:latest
docker push storjlabs/uplink:${TAG}
docker tag storjlabs/satellite:${TAG}${CUSTOMTAG} storjlabs/uplink:${LATEST_TAG}
docker push storjlabs/uplink:${LATEST_TAG}
docker tag storjlabs/gateway:${TAG} storjlabs/gateway:latest
docker push storjlabs/gateway:${TAG}
docker tag storjlabs/satellite:${TAG}${CUSTOMTAG} storjlabs/gateway:${LATEST_TAG}
docker push storjlabs/gateway:${LATEST_TAG}
endif
.PHONY: binaries-upload
binaries-upload: ## Upload binaries to Google Storage (jenkins)
@ -223,18 +227,18 @@ binaries-clean: ## Remove all local release binaries (jenkins)
rm -rf release
.PHONY: clean-images
ifeq (${BRANCH},master)
ifeq (${TRACKED_BRANCH},true)
clean-images: ## Remove Docker images from local engine
-docker rmi storjlabs/gateway:${TAG} storjlabs/gateway:latest
-docker rmi storjlabs/satellite:${TAG} storjlabs/satellite:latest
-docker rmi storjlabs/storagenode:${TAG} storjlabs/storagenode:latest
-docker rmi storjlabs/uplink:${TAG} storjlabs/uplink:latest
-docker rmi storjlabs/gateway:${TAG}${CUSTOMTAG} storjlabs/gateway:${LATEST_TAG}
-docker rmi storjlabs/satellite:${TAG}${CUSTOMTAG} storjlabs/satellite:${LATEST_TAG}
-docker rmi storjlabs/storagenode:${TAG}${CUSTOMTAG} storjlabs/storagenode:${LATEST_TAG}
-docker rmi storjlabs/uplink:${TAG}${CUSTOMTAG} storjlabs/uplink:${LATEST_TAG}
else
clean-images:
-docker rmi storjlabs/gateway:${TAG}
-docker rmi storjlabs/satellite:${TAG}
-docker rmi storjlabs/storagenode:${TAG}
-docker rmi storjlabs/uplink:${TAG}
-docker rmi storjlabs/gateway:${TAG}${CUSTOMTAG}
-docker rmi storjlabs/satellite:${TAG}${CUSTOMTAG}
-docker rmi storjlabs/storagenode:${TAG}${CUSTOMTAG}
-docker rmi storjlabs/uplink:${TAG}${CUSTOMTAG}
endif
.PHONY: test-docker-clean