ALERTS := porto porto-clusterwide

help:
	@echo
	@echo 'Alerts:'
	@echo ' ${ALERTS}'
	@echo
	@echo 'Targets:'
	@echo ' update        - upload all alerts'
	@echo ' get           - download all alerts'
	@echo ' render        - check all alerts'
	@echo

update get render:
	$(MAKE) $(addprefix $@-,${ALERTS})

update-%: %.yasm
	curl --data-binary @$< 'https://yasm.yandex-team.ru/srvambry/tmpl/alerts/update/content?key=${<:.yasm=}'

get-%: %.yasm
	curl 'https://yasm.yandex-team.ru/srvambry/tmpl/alerts/get/content?key=${<:.yasm=}' > $<

render-%: %.yasm
	curl 'https://yasm.yandex-team.ru/srvambry/tmpl/alerts/render_json/${<:.yasm=}'
