X-Git-Url: https://git.mdrn.pl/fnpdjango.git/blobdiff_plain/6d8e536282ff7e20950f36321989c94d6e44b363..218e31d1bc487866571736e4aa94180fd00884e3:/fnpdjango/deploy/__init__.py diff --git a/fnpdjango/deploy/__init__.py b/fnpdjango/deploy/__init__.py index 3256584..41089bf 100644 --- a/fnpdjango/deploy/__init__.py +++ b/fnpdjango/deploy/__init__.py @@ -12,8 +12,8 @@ Then set up some env properties: services: list of tasks to run after deployment """ -from fabric.api import * from os.path import abspath, dirname, exists, join +from fabric.api import * from fabric.contrib import files from fabric.tasks import Task, execute @@ -31,7 +31,7 @@ def setup(): run('mkdir -p %(app_path)s' % env, pty=True) run('%(virtualenv)s %(app_path)s/ve' % env, pty=True) - run('mkdir -p %(app_path)s/releases %(app_path)s/packages' % env, pty=True) + run('mkdir -p %(app_path)s/releases %(app_path)s/packages %(app_path)s/log' % env, pty=True) run('cd %(app_path)s/releases; ln -sfT . current; ln -sfT . previous' % env, pty=True) upload_samples() print "Fill out db details in localsettings.py and run deploy." @@ -107,8 +107,7 @@ class DebianGunicorn(Task): def run(self): print '>>> restart webserver using gunicorn-debian' - with path('/sbin'): - sudo('gunicorn-debian restart %s' % self.name, shell=False) + sudo('gunicorn-debian restart %s' % self.name, shell=False) class Apache(Task): def run(self): @@ -123,8 +122,7 @@ class Supervisord(Task): def run(self): print '>>> supervisord: restart %s' % self.name - with path('/sbin'): - sudo('supervisorctl restart %s' % self.name, shell=False) + sudo('supervisorctl restart %s' % self.name, shell=False) def check_setup(): require('app_path') @@ -201,7 +199,7 @@ def symlink_current_release(): print '>>> symlink current release' require('release', provided_by=[deploy]) require('app_path') - with cd(env.path): + with cd(env.app_path): run('rm releases/previous; mv releases/current releases/previous') run('ln -s %(release)s releases/current' % env)