action-env/Makefile
Vitaliy Potyarkin e8ca14a77b Logout from registry after pushing the image
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-24 17:04:03 +03:00

20 lines
499 B
Makefile

PUSH?=
REGISTRY?=git.frostfs.info
REGISTRY_NAMESPACE?=truecloudlab
REGISTRY_USER?=$(REGISTRY_NAMESPACE)
REGISTRY_PASSWORD?=
IMAGE=$(REGISTRY)/$(REGISTRY_NAMESPACE)/env
TAGS=$(patsubst %/.,%,$(wildcard */.))
.PHONY: $(TAGS)
$(TAGS):
buildah images
cd $@ && buildah bud --tag $(IMAGE):$@ .
buildah images
ifneq (,$(PUSH))
echo $$REGISTRY_PASSWORD | buildah login --username $(REGISTRY_USER) --password-stdin $(REGISTRY)
buildah push --rm $(IMAGE):$@ docker://$(IMAGE):$@
buildah logout
endif