.PHONY: upgrade help
OSTAG=$(shell uname -s | tr '[:upper:]' '[:lower:]')

help:
	@echo ""
	@echo "Targets:"
	@echo "\tupdate-go-dependencies - update go dependencies"
	@echo "\ttest             - run go test and gometalinter locally in a docker container"
	@echo "\tlocal            - run after 'make test' to run the built service on your laptop"
	@echo "         'AWS_PROFILE=twitch_ds_private make local' will emit cloudwatch metrics to your personal account"
	@echo ""


update-go-dependencies:
	dep ensure

clean:
	go clean ./...

dev:
	HOSTNAME=local_orchestrator AWS_PROFILE=twitch_ds_private AWS_DEFAULT_REGION=us-west-2 go run cmd/orchestrator/main.go -local

test:
	docker build -t service:latest-test -f Dockerfile-localtest .

local:
	# set AWS_PROFILE=your personal account and you will be able to see this process emit metrics to your cloudwatch
	# curl http://localhost:8443/debug/running to confirm it is running
	docker run -v ~/.aws:/root/.aws -p 8443:8443/tcp -e AWS_PROFILE=twitch_ds_private -e AWS_DEFAULT_REGION=us-west-2 service:latest-test /go/bin/orchestrator
