CONFIG = RELEASER_PROJECT_CONFIG=".release.stand.hjson"
source ?= $(name)

stand: check-name
	@$(CONFIG) releaser env-dump -e $(source) --dump .stand.dump || $(CONFIG) releaser env-dump -e stand --dump .stand.dump
	@$(CONFIG) releaser stand --standname $(name) $(args) || true
	@rm .stand.dump

delete-stand: check-name
	@$(CONFIG) releaser env-delete -e $(name);

check-name:
	@test $(name) || (echo 'Usage: make COMMAND name=STANDNAME'; exit 1)

test:
	docker-compose run backend pytest -p no:warnings /src
