-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
48 lines (39 loc) · 1.54 KB
/
justfile
File metadata and controls
48 lines (39 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Vars
db_name := "snippet-manager-db"
project_dir := justfile_dir()
using_infisical := path_exists(project_dir + "/.infisical.json")
infisical_command := if using_infisical == "true" { "infisical run --env=dev --path=/app -- " } else { "" }
# Start all Servers
start:
@echo "Starting all servers"
just --justfile {{ justfile() }} db-start
just --justfile {{ justfile() }} server-start
# Run fast api dev server
server-start:
just --justfile {{ justfile() }} build-styles
@cd "{{ project_dir }}"; {{ infisical_command }} uv run alembic upgrade head
@cd "{{ project_dir }}"; {{ infisical_command }} uv run fastapi dev app/app.py
# Clear db and start all services
fresh-start:
@echo "Clearing database and starting all servers"
just --justfile {{ justfile() }} db-stop
just --justfile {{ justfile() }} start
# Start the mkdocs server
docs-start:
@cd "{{ project_dir }}"; source .env; {{ infisical_command }} uv run mkdocs serve -a 0.0.0.0:8080
# Start the postgres db
db-start:
@echo "Starting database"
# TODO: Better way to check if the container is already running
docker run --name {{ db_name }} -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres || true
# Stop the postgres db
db-stop:
@echo "Stopping database"
docker stop {{ db_name }} || true
docker rm {{ db_name }} || true
# Npm watch styles
watch-styles:
@cd "{{ project_dir }}"; {{ infisical_command }} npm run watch-styles
# Npm build styles
build-styles:
@cd "{{ project_dir }}"; {{ infisical_command }} npm run build-styles