Over a million developers have joined DZone.
Platinum Partner

Using a Proxy for Capifony/Capistrano Deployments

· DevOps Zone

The DevOps Zone is brought to you in partnership with HPE.  Learn about the seven KPI’s that create the foundation of DevOps metrics and how it continues to evolve as the DevOps Methodology becomes more engrained in enterprises.  

I’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!

The DevOps Zone is brought to you in partnership with HPE.  Discover the Top 5 predictions for DevOps and the central role they will play as enterprises begin to modernize legacy applications.

Topics:

Published at DZone with permission of Bas De Nooijer , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}