-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfabfile.py
More file actions
21 lines (17 loc) · 772 Bytes
/
fabfile.py
File metadata and controls
21 lines (17 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from fabric import task
from invoke import run as local
from patchwork.transfers import rsync
exclude_dirs = [".git", "node_modules", ".cache", ".github", "db.sqlite3"]
@task
def deploy(ctx):
local("yarn build", echo=True)
local("python manage.py collectstatic --noinput --clear", echo=True)
rsync(ctx, "static/", "apps/django-sockpuppet-expo/static/",
exclude=exclude_dirs)
rsync(ctx, "webpack-stats.json", "apps/django-sockpuppet-expo/")
with ctx.cd("~/apps/django-sockpuppet-expo"):
ctx.run('git pull')
with ctx.prefix("source .env/bin/activate"):
ctx.run('python -m pip install --upgrade -r requirements.in')
ctx.run('python manage.py migrate')
ctx.run("sudo supervisorctl restart expo:*")