Commit b0b59abd authored by Janez K's avatar Janez K
Browse files

dodal fabric file, na live sm pobrisu hooke

parent b2e1084c
from __future__ import with_statement
from fabric.api import *
from fabric.colors import *
from fabric.utils import puts, abort
env.use_ssh_config = True
apps_to_migrate = ('workflows',)
def live():
""" doloci live server kot aktivni """
env.os = 'ubuntu'
env.hosts = ['']
env.branch = 'master'
def deploy():
""" deploy na serverju
$ fab live deploy
with cd('/srv/django-projects/mothra'):
puts(yellow("[Pulling from origin, on branch %s]" % (env.branch,)))
run('git pull origin %s' % (env.branch,))
run('git checkout %s' % (env.branch,))
puts(yellow("[Installing packages]"))
run('pip install -qr requirements.txt')
puts(yellow("[Migrating apps]"))
for app in apps_to_migrate:
puts("--> [Migrating %s]" % (app,))
run('python migrate %s --no-initial-data' % (app, ))
puts(yellow("[Collecting static files]"))
run("python collectstatic --noinput")
puts(yellow("[Auto importing packages]"))
run("python auto_import_packages")
#run('python compress')
def apache_restart():
"""restarta apache service
$ fab dev apache_restart
$ fab live apache_restart
if env.os == 'ubuntu':
sudo('service apache2 restart')
elif env.os == 'arch':
sudo('rc.d restart httpd')
abort('env.os ni definiran, kaj je zdej to')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment