forked from devroastproject/devroastproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
31 lines (25 loc) · 1.05 KB
/
tasks.py
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
from os import truncate
from subprocess import run
u_options = {
1: "Bootstrap containers.",
2: "Boot Django dev server.",
3: "Run migrations for all apps.",
4: "Run unit tests.",
}
for key, val in u_options.items():
print(key, val)
# Prompt the user to make a choice
u_choice = int(input("Enter an int: "))
if u_choice == 1:
run(['docker-compose', 'up'], check=True)
elif u_choice == 2:
run(['docker-compose', 'exec', 'django', 'manage.py', 'runserver'], check=True)
elif u_choice == 3:
run(['docker-compose', 'exec', 'django', 'python', 'manage.py', 'makemigrations', 'users'], check=True)
run(['docker-compose', 'exec', 'django', 'python', 'manage.py', 'migrate'], check=True)
run(['docker-compose', 'exec', 'django', 'python', 'manage.py', 'makemigrations', 'project'], check=True)
run(['docker-compose', 'exec', 'django', 'python', 'manage.py', 'migrate'], check=True)
elif u_choice == 4:
run(['docker-compose', 'exec', 'django', 'python', 'manage.py', 'test'], check=True)
else:
print("Invalid choice.")