2017-12-13 14:24:28 +00:00
|
|
|
IMAGENAME?=$(NAME)
|
|
|
|
IMAGEWTAG?=$(IMAGENAME):$(VERSION)
|
2017-09-27 19:08:21 +00:00
|
|
|
|
2017-09-29 13:11:08 +00:00
|
|
|
docker-login: ## Log in to the registry. It will only be used in the server, or when running a CI task locally (if CI_BUILD_TOKEN is set).
|
2017-09-27 19:08:21 +00:00
|
|
|
ifeq ($(CI_BUILD_TOKEN),)
|
|
|
|
@echo "Not logging in to the docker registry" "$(CI_REGISTRY)"
|
|
|
|
else
|
|
|
|
@docker login -u gitlab-ci-token -p $(CI_BUILD_TOKEN) $(CI_REGISTRY)
|
|
|
|
endif
|
|
|
|
ifeq ($(HUB_USER),)
|
|
|
|
@echo "Not logging in to global the docker registry"
|
|
|
|
else
|
|
|
|
@docker login -u $(HUB_USER) -p $(HUB_PASSWORD)
|
|
|
|
endif
|
|
|
|
|
2017-09-29 13:32:11 +00:00
|
|
|
docker-clean: ## Remove docker credentials
|
2017-09-27 19:08:21 +00:00
|
|
|
ifeq ($(HUB_USER),)
|
|
|
|
else
|
|
|
|
@docker logout
|
|
|
|
endif
|
|
|
|
|
2017-09-29 13:32:51 +00:00
|
|
|
login:: docker-login
|
|
|
|
|
|
|
|
clean:: docker-clean
|
|
|
|
|
2017-12-13 14:24:28 +00:00
|
|
|
docker-info:
|
|
|
|
@echo IMAGEWTAG=${IMAGEWTAG}
|
|
|
|
|
2017-09-29 13:11:08 +00:00
|
|
|
.PHONY:: docker-login docker-clean login clean
|