APPLICATION=`find ./app -mindepth 1 -maxdepth 1 -type d`
BINARIES=`find ./cmd -mindepth 1 -maxdepth 1 -type d`

dev:
	go run cmd/dev/*.go

mmdb:
	rm -rf mmdb
	mkdir mmdb
	curl https://packages.internal.justin.tv/artifactory/ip-twitch-geoip/current/GeoIP2-City.mmdb > ./mmdb/GeoIP2-City.mmdb
	curl https://packages.internal.justin.tv/artifactory/ip-twitch-geoip/current/GeoIP2-ISP.mmdb > ./mmdb/GeoIP2-ISP.mmdb

build:
	GOOS=linux packr build -ldflags "-w -s" -o ./bin/portal-app/handler ./cmd/lambda
	rm -f ./bin/portal-app.zip && zip -r ./bin/portal-app.zip ./bin/portal-app/handler

deps:
	@echo "Updating dependencies..."
	dep ensure -update
	@echo "Dependency versions:"
	@dep status
