This repository has been archived on 2021-12-24. You can view files and clone it, but cannot push or open issues/pull-requests.
hilde/Makefile

60 lines
817 B
Makefile
Raw Permalink Normal View History

2021-06-25 12:48:45 +02:00
# The main usecase for this Makefile is to simplify database management
all: build
.PHONY: all
# =====CARGO STUFF=====
build:
@ cargo build
.PHONY: build
run:
@ cargo run
.PHONY: run
test:
@ cargo test
.PHONY: test
lint:
@ cargo fmt -- --check
@ cargo clippy --all-targets -- -D warnings
.PHONY: lint
2021-06-27 15:00:55 +02:00
format:
@ cargo fmt
.PHONY: format
2021-06-25 12:48:45 +02:00
# =====DATABASE STUFF=====
db:
@ docker run \
--rm \
-itd \
-v hilde_db-data:/var/lib/postgresql/data \
-e POSTGRES_USER=hilde \
-e POSTGRES_PASSWORD=hilde \
2021-06-27 11:11:01 +02:00
-e POSTGRES_DB=hilde \
2021-06-25 12:48:45 +02:00
--name hilde_db \
-p 5432:5432 \
postgres:13-alpine
.PHONY: db
psql:
@ docker exec \
-it hilde_db \
psql -U hilde
.PHONY: psql
stop-db:
@ docker stop hilde_db
.PHONY: stop-db
# =====DOCKER STUFF=====
image:
@ docker build -t hilde:latest .
2021-06-25 12:51:17 +02:00
.PHONY: image