Using a Proxy for Capifony/Capistrano Deployments
Join the DZone community and get the full member experience.
Join For FreeI’m currently working on a Symfony2 based project. For deployments to various environments we use Capifony, a collection of Capistrano recipes for Symfony applications. This works like a charm, however there was one issue with the production environment. Due to the setup of this server web access is only possible using a proxy. This caused issues for the deployment, as for instance it was not possible to run Composer during deployment as it needs to download libraries.
After some research I found several options to work around this. I ended up with this:
default_run_options[:env] = { 'http_proxy' => '10.11.3.100:8080', 'https_proxy' => '10.11.3.100:8080', 'HTTPS_PROXY_REQUEST_FULLURI' => 'false', }
By using the Capistrano multistage extension this setting is only applied for the production environment, as testing and acceptance don’t require the use of a proxy. The first two options set ‘standard’ proxy environment settings. The last setting is specifically for Composer. Somehow certain libraries couldn’t be downloaded using the Github API over https.
This fixed it, and now the deployment works perfectly using the proxy!
Published at DZone with permission of Bas De Nooijer, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments