Skip to content

Commit eac7c0c

Browse files
committed
Use fabdeploy helpers for deciding when to rebuild venv.
1 parent 50b4a93 commit eac7c0c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

fabfile.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ def managecmd(cmd):
2525

2626

2727
@task
28-
def create_virtualenv():
29-
if VIRTUALENV.startswith(pjoin('/data', 'src', settings.CLUSTER)):
30-
local('rm -rf %s' % VIRTUALENV)
31-
28+
def create_virtualenv(update_on_change=False):
3229
helpers.create_venv(VIRTUALENV, settings.PYREPO,
33-
pjoin(ZAMBONI, 'requirements/prod.txt'))
30+
pjoin(ZAMBONI, 'requirements/prod.txt'),
31+
update_on_change=update_on_change)
3432

3533
if settings.LOAD_TESTING:
3634
helpers.pip_install_reqs(pjoin(ZAMBONI, 'requirements/load.txt'))
@@ -157,13 +155,7 @@ def pre_update(ref=settings.UPDATE_REF):
157155

158156
@task
159157
def update():
160-
def get_status():
161-
with lcd(ZAMBONI):
162-
return local('git diff HEAD@{1} HEAD --name-only', capture=True)
163-
164-
if not getattr(settings, 'DEV', False) or 'requirements/' in get_status():
165-
execute(create_virtualenv)
166-
158+
execute(create_virtualenv, getattr(settings, 'DEV', False))
167159
execute(update_locales)
168160
execute(update_products)
169161
execute(compress_assets)

0 commit comments

Comments
 (0)