2025-01-20 20:40:42 +01:00
|
|
|
# Load the .env file
|
|
|
|
|
ifneq (,$(wildcard ./.env))
|
|
|
|
|
include .env
|
|
|
|
|
export $(shell sed 's/=.*//' .env)
|
|
|
|
|
endif
|
2025-01-11 03:01:40 +01:00
|
|
|
|
2025-01-11 01:44:39 +01:00
|
|
|
go-run:
|
2025-01-20 20:40:42 +01:00
|
|
|
cd src; go run cmd/frontend/main.go;
|
2025-01-11 03:01:40 +01:00
|
|
|
|
2025-01-12 17:36:30 +01:00
|
|
|
migrate-up:
|
|
|
|
|
goose -dir=./src/assets/migrations/ postgres "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)" up
|
|
|
|
|
|
|
|
|
|
migrate-down:
|
|
|
|
|
goose -dir=./src/assets/migrations/ postgres "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)" down
|
|
|
|
|
|
2025-01-11 03:01:40 +01:00
|
|
|
docker-push: docker-build
|
|
|
|
|
docker push git.kohout-dev.de/crowsnest/crowsnest:latest
|
2025-01-11 01:44:39 +01:00
|
|
|
|
|
|
|
|
docker-run: docker-build
|
2025-01-11 03:01:40 +01:00
|
|
|
docker run \
|
|
|
|
|
--env DB_HOST=$(DB_HOST) \
|
|
|
|
|
--env DB_PORT=$(DB_PORT) \
|
|
|
|
|
--env DB_NAME=$(DB_NAME) \
|
|
|
|
|
--env DB_USER=$(DB_USER) \
|
|
|
|
|
--env DB_PASS=$(DB_PASS) \
|
|
|
|
|
--rm -p 8080:8080 git.kohout-dev.de/crowsnest/crowsnest:latest
|
2025-01-11 01:44:39 +01:00
|
|
|
|
|
|
|
|
docker-build:
|
2025-01-11 03:01:40 +01:00
|
|
|
docker build \
|
|
|
|
|
--build-arg DB_HOST=$(DB_HOST) \
|
|
|
|
|
--build-arg DB_PORT=$(DB_PORT) \
|
|
|
|
|
--build-arg DB_NAME=$(DB_NAME) \
|
|
|
|
|
--build-arg DB_USER=$(DB_USER) \
|
|
|
|
|
--build-arg DB_PASS=$(DB_PASS) \
|
|
|
|
|
--platform linux/amd64 \
|
|
|
|
|
-t git.kohout-dev.de/crowsnest/crowsnest:latest .
|