forked from david-mears/eahub.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
33 lines (21 loc) · 831 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
from fabric import operations
from fabric.api import local
def build():
local("docker-compose build")
local("docker build -t eahub:latest .")
local("y | docker system prune")
def run():
local("docker-compose run --service-ports web") # with ipdb support
# local('docker-compose up') # without ipdb support
def makemigrations():
local("docker-compose run web django-admin makemigrations")
def migrate():
local("docker-compose run web django-admin migrate")
def deploy():
build()
local("docker tag eahub eahub.azurecr.io/eahub:latest")
local("docker push eahub.azurecr.io/eahub:latest")
def bash():
local("docker ps")
container_id = operations.prompt("Enter container_id from above: ")
local("docker exec -t -i {container_id} bash".format(container_id=container_id))