prefixed_command = '/bin/bash -l -i -c "%s"' % command
return local(prefixed_command)
- env.run = _custom_local
# This is required for the same reason as above
env.proj_root = '/var/www/karmaworld'
env.cd = lcd
env.reqs = 'reqs/prod.txt'
env.confs = 'confs/prod/'
env.branch = 'beta'
- env.run = virtenv_exec
env.gunicorn_addr = '127.0.0.1:8000'
####### Define beta host
env.reqs = 'reqs/prod.txt'
env.confs = 'confs/prod/'
env.branch = 'beta'
- env.run = virtenv_exec
######## Run Commands in Virutal Environment
def virtenv_exec(command):
Collect static files (if AWS config. present, push to S3)
"""
- env.run('%s/manage.py collectstatic --noinput' % env.proj_root )
+ virtenv_exec('%s/manage.py collectstatic --noinput' % env.proj_root )
####### Run Dev Server
@task
Runs the built-in django webserver
"""
- env.run('%s/manage.py runserver' % env.proj_root)
+ virtenv_exec('%s/manage.py runserver' % env.proj_root)
####### Create Virtual Environment
@task
"""
Starts supervisord
"""
- config_file = '/var/www/karmaworld/confs/prod/supervisord.conf'
- env.run('supervisord -c %s' % config_file)
+ virtenv_exec('supervisord -c {0}/confs/{1}/supervisord.conf'.format(env.code_root, env.branch))
@task
Restarts supervisord
"""
config_file = '/var/www/karmaworld/confs/prod/supervisord.conf'
- env.run('supervisorctl -c %s shutdown' % config_file)
+ virtenv_exec('supervisorctl -c %s shutdown' % config_file)
@task
be performed on it: start|stop|restart.
"""
supervisor_conf = '/var/www/karmaworld/confs/prod/supervisord.conf'
- env.run('supervisorctl -c %s %s %s' % (supervisor_conf, action, process))
+ virtenv_exec('supervisorctl -c %s %s %s' % (supervisor_conf, action, process))
@task