forked from alfredo/popcorn_maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
63 lines (45 loc) · 1.59 KB
/
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
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
import os
import manage
from fabric.api import run, local, env, get, prompt, sudo
from fabric.colors import yellow
from fabric.contrib import console, django
from fabric.context_managers import lcd
django.settings_module('popcorn_gallery.settings')
from django.conf import settings
def test(*args):
"""Run the tests locally takes a list of apps to test as arguments"""
os.environ['FORCE_DB'] = '1'
print yellow('Runing tests')
with lcd(settings.PROJECT_ROOT):
local('python manage.py test --noinput '
'--settings=popcorn_gallery.settings.test')
def prepare_butter():
print yellow('Compiling Butter files.')
with lcd(os.path.join(settings.PROJECT_ROOT, 'butter')):
local('npm install')
local('npm update')
local('node make')
def syncdb():
print yellow('Syncing the database')
with lcd(settings.PROJECT_ROOT):
local('python manage.py syncdb --noinput')
local('python manage.py migrate --noinput')
def copy_butter_style():
print yellow('Coping Butter styling')
with lcd(settings.PROJECT_ROOT):
local('cp butter/css/butter.ui.css assets/css/')
def update_index():
print yellow('Updating search index')
with lcd(settings.PROJECT_ROOT):
local('python manage.py update_index')
def update():
print yellow('Updating the site:')
syncdb()
prepare_butter()
copy_butter_style()
update_index()
def collectstatic():
prepare_butter()
print yellow('Collecting static files.')
with lcd(settings.PROJECT_ROOT):
local('python manage.py collectstatic --noinput')