Commit 202a34c0a0373585e8c8c35087c877979f9a6ed4
1 parent
35a32c37
Exists in
master
and in
39 other branches
Updating fab file to load badges locally too
Showing
1 changed file
with
6 additions
and
5 deletions
Show diff stats
fabfile.py
... | ... | @@ -89,13 +89,15 @@ def deploy(update=False): |
89 | 89 | sudo('supervisorctl restart all') |
90 | 90 | |
91 | 91 | |
92 | -def load_badges(): | |
92 | +def load_badges(local=False): | |
93 | + path = '/vagrant/' if local else '~/colab/' | |
93 | 94 | |
94 | - run('mkdir -p ~/colab/www/media/badges') | |
95 | + run(u'mkdir -p {}www/media/badges'.format(path)) | |
95 | 96 | |
96 | - with cd('~/colab/src/'), prefix(WORKON_COLAB): | |
97 | + with cd(u'{}src/'.format(path)), prefix(WORKON_COLAB): | |
97 | 98 | run('cp badger/fixtures/images/*.png ../www/media/badges/') |
98 | 99 | run('python manage.py loaddata badger/fixtures/badges.json') |
100 | + run('python manage.py update_badges') | |
99 | 101 | |
100 | 102 | |
101 | 103 | def rebuild_index(age=None, batch=None): |
... | ... | @@ -135,6 +137,5 @@ def runserver(update_requirements=False): |
135 | 137 | |
136 | 138 | run('python manage.py syncdb') |
137 | 139 | run('python manage.py migrate') |
138 | - run('python manage.py loaddata badger/fixtures/badges.json') | |
139 | - run('python manage.py update_badges') | |
140 | + load_badges(local=True) | |
140 | 141 | run('python manage.py runserver 0.0.0.0:7000') | ... | ... |