diff --git a/.gitignore b/.gitignore index e34271c..5025c5e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ go.work persistence .DS_Store + +# env +.env diff --git a/Makefile b/Makefile index a4a9269..20d7b2c 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -DB_HOST="10.99.0.3" -DB_PORT="5432" -DB_NAME="crowsnest_dev" -DB_USER="crow_dev" -DB_PASS="hL0VlXkH2WoHL7c7FdRTHXMy" +# Load the .env file +ifneq (,$(wildcard ./.env)) + include .env + export $(shell sed 's/=.*//' .env) +endif go-run: - cd src; DB_USER=$(DB_USER) DB_PASS=$(DB_PASS) DB_NAME=$(DB_NAME) DB_HOST=$(DB_HOST) go run cmd/frontend/main.go + cd src; go run cmd/frontend/main.go; migrate-up: goose -dir=./src/assets/migrations/ postgres "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)" up