-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
108 lines (80 loc) · 2.22 KB
/
justfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
set dotenv-load := false
@_default:
just --list
# Format the justfile
@fmt:
just --fmt --unstable
# Performs initial setup for Docker images and allows Arguments to be passed
bootstrap *ARGS:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f ".env" ]; then
echo ".env created"
cp .env.dev.example .env
fi
mise install
docker compose {{ ARGS }} build --force-rm
# Builds the Docker Images with no optional arguments
@cibuild:
just build
# Builds the Docker Images with optional arguments
@build *ARGS:
docker compose {{ ARGS }} build
# Perform the initial setup for the Docker containers
@setup:
just bootstrap
# --------------------------------------------------
# Docker recipes
# --------------------------------------------------
# Bring down your docker containers
@down *ARGS:
docker compose down {{ ARGS }}
# Allows you to view the output from running containers
@logs *ARGS:
docker compose logs {{ ARGS }}
# Restart all services
@restart *ARGS:
docker compose restart {{ ARGS }}
# Start all services
@start *ARGS="--detach":
docker compose up {{ ARGS }}
@status:
docker compose ps
# Stop all services
@stop:
docker compose down
# Tail service logs
@tail:
just logs --follow
# Bring up your Docker Containers
@up *ARGS:
docker compose up {{ ARGS }}
# Django recipes
# --------------------------------------------------
# Drop into the console on the docker image
@console:
docker compose run --rm django /bin/bash
@manage *ARGS:
docker compose run --rm django python manage.py {{ ARGS }}
@makemigrations *ARGS:
just manage makemigrations {{ ARGS }}
@migrate *ARGS:
just manage migrate {{ ARGS }}
@showmigrations *ARGS:
just manage showmigrations {{ ARGS }}
# Run the shell management command
@shell *ARGS:
just manage shell {{ ARGS }}
# Create a Superuser
@createsuperuser USERNAME EMAIL:
just manage createsuperuser \
--username={{ USERNAME }} \
--email={{ EMAIL }}
@pipcompile:
uv pip compile requirements.in -o requirements.txt
@pipsync:
uv pip sync requirements.txt
@pytest *ARGS:
docker compose run --rm django pytest {{ ARGS }}
@mypy *ARGS:
docker compose run --rm django mypy {{ ARGS }}