4 ms·
Good point. Here's the 'dev' task: def dev(): '''Run on the development (i.e. Vagrant) server.''' env.env_name = 'development' env
by stevelosh 15y ago
Good point. Here's the 'dev' task:
def dev():
'''Run on the development (i.e. Vagrant) server.'''
env.env_name = 'development'
env.site_name = 'MYSITE'
env.process_name = 'gunicorn-MYSITE'
env.process_owner = 'gunicorn'
env.puppet_manifest = 'dev.pp'
ssh_info = local('vagrant ssh_config', capture=True).splitlines()[1:]
ssh_info = dict([l.strip().split(' ', 1) for l in ssh_info if l.strip()])
env.key_filename = ssh_info['IdentityFile']
env.hosts = ['%(User)s@%(HostName)s:%(Port)s' % ssh_info]
env.site_path = '/var/www/MYSITE/MYSITE'
env.venv_path = '/var/www/.virtualenvs/MYSITE'
env.site_url = 'http://localhost:4565'
In a nutshell: it uses `vagrant ssh_config` to get the SSH info at runtime.