.PHONY: all build tag push version

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

all: build tag push

build:
	mkdir .tmp || true
	ya make --target-platform=DEFAULT-LINUX-X86_64 -r
	cp -L burp-collaborator-fetcher .tmp/burp-collaborator-fetcher
	docker build -t security/burp-collaborator-fetcher .
	rm -rf .tmp

tag:
	docker tag security/burp-collaborator-fetcher registry.yandex.net/security/burp-collaborator-fetcher:$(VERSION)

push:
	docker push registry.yandex.net/security/burp-collaborator-fetcher:$(VERSION)
	@echo
	@echo "Well done!"
	@echo "Uploaded: registry.yandex.net/security/burp-collaborator-fetcher:$(VERSION)"
