-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
34 lines (18 loc) · 935 Bytes
/
fabfile.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
32
33
34
from fabric.api import local
def makemigrations(app=''):
local("docker exec -i $(docker ps | grep server_ | awk '{{ print $1 }}') python manage.py makemigrations {}".format(
app))
def migrate(app=''):
local("docker exec -i $(docker ps | grep server_ | awk '{{ print $1 }}') python manage.py migrate {}".format(app))
def createsuperuser():
local("docker exec -it $(docker ps | grep server_ | awk '{{ print $1 }}') python manage.py createsuperuser")
def bash():
local("docker exec -it $(docker ps | grep server_ | awk '{{ print $1 }}') bash")
def shell():
local("docker exec -it $(docker ps | grep server_ | awk '{{ print $1 }}') python manage.py shell")
def dev():
local("docker-compose run --rm --service-ports server")
def kill():
local("docker kill $(docker ps -q)")
def test():
local("docker exec -it $(docker ps | grep server_ | awk '{{ print $1 }}') python manage.py test")