1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-22 08:12:27 +00:00
senpy/.makefiles/docker.mk
J. Fernando Sánchez 1a3b8ee703 Add '.makefiles/' from commit '21ff551769dd7e4ebd895b90d918040859a90e41'
git-subtree-dir: .makefiles
git-subtree-mainline: 9c61c18220
git-subtree-split: 21ff551769
2017-10-03 11:28:56 +02:00

26 lines
665 B
Makefile

IMAGEWTAG ?= $(IMAGENAME):$(VERSION)
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).
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
docker-clean: ## Remove docker credentials
ifeq ($(HUB_USER),)
else
@docker logout
endif
login:: docker-login
clean:: docker-clean
.PHONY:: docker-login docker-clean login clean