.PHONY: all build tag push version

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

all: build tag push
all-dev: build-dev tag-dev push-dev

build:
	ya make --target-platform=linux . 
	docker build -t security/hunter .

tag:
	docker tag security/hunter registry.yandex.net/security/hunter:$(VERSION)

build-dev:
	ya make --target-platform=linux .
	docker build -t security/hunter-dev .

tag-dev:
	docker tag security/hunter-dev registry.yandex.net/security/hunter-dev:$(VERSION)

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

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