Skip to content
Browse files

dirty deploys now just copy the previous good virtualenv

(so make sure they're good; rollback by setting current to point
to a good one and kick your webserver suitably)
  • Loading branch information...
1 parent 5578885 commit 746b9207071c723f6626d3a08a69a65ca1bfc9f5 @jaylett jaylett committed
Showing with 14 additions and 1 deletion.
  1. +14 −1 fabfile.py
View
15 fabfile.py
@@ -58,7 +58,10 @@ def deploy(dirty=False):
ponder_release()
export_and_upload_tar_from_git()
- make_release_virtualenv()
+ if dirty:
+ copy_previous_virtualenv()
+ else:
+ make_release_virtualenv()
prepare_release(dirty)
switch_to(env.release)
restart_webserver()
@@ -119,6 +122,16 @@ def upload_tar():
run('cd %s/releases && gzip -dc ../archives/%s.tar.gz | tar xf -' % (env.path, env.release))
local('rm %s.tar.gz' % env.release)
+def copy_previous_virtualenv():
+ "Copy a previous virtualenv, for when making a new one is too much of a PITA"
+ require('release', provided_by=[deploy])
+ run(
+ "cp -a %(path)s/releases/current/ENV %(path)s/releases/%(release)s/ENV" % {
+ 'path': env.path,
+ 'release': env.release,
+ }
+ )
+
def make_release_virtualenv():
"Make a virtualenv and install the required packages into it"
require('release', provided_by=[deploy])

0 comments on commit 746b920

Please sign in to comment.
Something went wrong with that request. Please try again.