.PHONY: all build push push-latest

all: build push

VERSION := $(shell date +%Y-%m-%dT%H.%M)

build:
	docker build -t security/xray-test-old-with-secrets --file ./Dockerfile.old_with_secrets .
	docker build -t security/xray-test-vuln-pkgs --file ./Dockerfile.vuln_pkgs .

push:
	docker tag security/xray-test-old-with-secrets "registry.yandex.net/security/xray-test-old-with-secrets:${VERSION}"
	docker tag security/xray-test-vuln-pkgs "registry.yandex.net/security/xray-test-vuln-pkgs:latest"
	docker push "registry.yandex.net/security/xray-test-old-with-secrets:${VERSION}"
	docker push "registry.yandex.net/security/xray-test-vuln-pkgs:latest"
	@echo
	@echo "Well done!"
	@echo "Uploaded: registry.yandex.net/security/xray-test-old-with-secrets:$(VERSION)"
	@echo "Uploaded: registry.yandex.net/security/xray-test-vuln-pkgs:latest"
