5 ms·
I would love to see more details of the fabric+vagrant integration. For instance, you don't show how the prod/dev prefixes in your fabric commands are used to
by cabacon 15y ago
I would love to see more details of the fabric+vagrant integration. For instance, you don't show how the prod/dev prefixes in your fabric commands are used to set the vagrant destination host, or the site urls. The vagrant way of things seems to be using "vagrant ssh". I know it sets up port forwarding to accomplish that, but how are you establishing the map of port# -> environment type? Just by convention, within the Vagrantfile?
- stevelosh 15y agoGood 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.