Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update scripts/update/update.py

  • Loading branch information...
commit bad54d8310791fb41b00c1b400d68b16887e1a6b 1 parent 75646fa
@oremj oremj authored
Showing with 13 additions and 15 deletions.
  1. +13 −15 scripts/update/update.py
View
28 scripts/update/update.py
@@ -17,22 +17,20 @@
@task
def create_virtualenv(ctx):
venv = settings.VIRTUAL_ENV
- try:
- try:
- ctx.local("virtualenv --distribute --never-download %s" % venv)
- except BadReturnCode:
- pass # if this is really broken, then the pip install should fail
-
- ctx.local("%s/bin/pip install --exists-action=w --no-deps --no-index "
- "--download-cache=/tmp/pip-cache -f %s "
- "-r %s/requirements.txt" %
- (venv, settings.PYREPO, settings.SRC_DIR))
- finally:
- # make sure this always runs
- ctx.local("rm -f %s/lib/python2.6/no-global-site-packages.txt" % venv)
- ctx.local("%s/bin/python /usr/bin/virtualenv --relocatable %s"
- % (venv, venv))
+ if not venv.startswith('/data'):
+ raise Exception('venv must start with /data') # this is just to avoid rm'ing /
+ ctx.local('rm -rf %s' % venv)
+ ctx.local('virtualenv --distribute --never-download %s' % venv)
+
+ ctx.local('%s/bin/pip install --exists-action=w --no-deps --no-index '
+ '--download-cache=/tmp/pip-cache -f %s '
+ '-r %s/requirements/prod.txt' %
+ (venv, settings.PYREPO, settings.SRC_DIR))
+
+ # make sure this always runs
+ ctx.local("rm -f %s/lib/python2.6/no-global-site-packages.txt" % venv)
+ ctx.local("%s/bin/python /usr/bin/virtualenv --relocatable %s" % (venv, venv))
@task
def update_code(ctx, tag):
Please sign in to comment.
Something went wrong with that request. Please try again.