cyberia/research/mimi/Makefile

.PHONY: format vet
include example.env
-include .env

run: vet
	go run main.go

install:
	mkdir -p $(HOME)/.local/bin/
	wget -O $(HOME)/.local/bin/sleek https://github.com/nrempel/sleek/releases/download/v0.5.0/sleek-linux-x86_64
	chmod +x $(HOME)/.local/bin/sleek
	go install honnef.co/go/tools/cmd/staticcheck@latest
	go install github.com/air-verse/air@latest
	go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
	go install github.com/pressly/goose/v3/cmd/goose@latest
	go mod download

vet: format
	go vet ./...
	staticcheck ./...

format:
	go fmt ./...
	sleek ./sql/migrations/*
	sleek ./sql/queries/*

test: vet
	go test -v ./...

sqlc: format
	sqlc generate

migrate-up:
	GOOSE_DRIVER=postgres GOOSE_DBSTRING="$(DATABASE_URL)" goose -dir sql/migrations up

migrate-down:
	GOOSE_DRIVER=postgres GOOSE_DBSTRING="$(DATABASE_URL)" goose -dir sql/migrations down

db-container = mimi-dev-db
dev-db:
	test -n "$(DB_USER)" || exit 1
	test -n "$(DB_PASSWORD)" || exit 1
	test -n "$(DB_NAME)" || exit 1
	test -n "$(DB_PORT)" || exit 1
	podman stop $(db-container) || exit 0
	podman run --rm -d \
		--name=$(db-container) \
		-e POSTGRES_PASSWORD="$(DB_PASSWORD)" \
		-e POSTGRES_USER="$(DB_USER)" \
		-e POSTGRES_DB="$(DB_NAME)" \
		-p "$(DB_PORT)":5432 \
		docker.io/pgvector/pgvector:pg17

psql:
	PGPASSWORD=$(DB_PASSWORD) psql -U $(DB_USER) -d $(DB_NAME) -p $(DB_PORT) -h localhost

build:
	GOOS=linux \
	go build \
		-o /tmp/mimi \
		./main.go

fetch-github-projects:
	go run cmd/fetch-github-projects/main.go

Homonyms

cyber/Makefile
cyb/Makefile
cyberia/research/events/Makefile
cyberia/research/events/client/Makefile
cyberia/research/events/deploy/Makefile
cyberia/research/mimi/deploy/Makefile
cyberia/research/events/ethereum/Makefile
cyberia/research/events/backend/Makefile

Graph