X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f7712b20c83a39b1020064cb87b1128f87b0ae51..00a90d6175599e055f5a84697c8388d81ac1b007:/fabfile.py diff --git a/fabfile.py b/fabfile.py index b132b9dd..399f1c2f 100644 --- a/fabfile.py +++ b/fabfile.py @@ -61,18 +61,26 @@ def setup(): """ require('hosts', 'sandbox', provided_by=[staging, production]) - run("mkdir -p %(path)s; mkdir -p %(path)s/www/wsgi;" % env) + run("mkdir -p %(path)s; mkdir -p %(path)s/www/wsgi; mkdir -p %(path)s/www/media" % env) # make a git mirror - run("""\ -cd %(path)s; + run("""cd %(path)s; git clone %(giturl)s mirror; cd %(path)s/mirror; git pull""" % env, pty=True) run('%(virtualenv)s %(path)s' % env, pty=True) - run('cd %(path)s; mkdir -p releases; mkdir -p shared; mkdir -p packages;' % env, pty=True) + run('cd %(path)s; rm -rf releases shared packages; mkdir -p releases; mkdir -p shared; mkdir -p packages;' % env, pty=True) + + # symlink static content + run("""cd %(path)s/www/media; +ln -sf %(path)s/releases/current/%(project_name)s/static static +ln -sf %(path)s/lib/python2.6/site-packages/django/contrib/admin/media admin-media +mkdir -p dynamic +""" % env) + run('cd %(path)s/releases; ln -s . current; ln -s . previous' % env, pty=True) + deploy()