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 New Relic.  Learn more about the common barriers to DevOps adoption so that you can come up with ways to win over the skeptics and kickstart DevOps.

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 New Relic. Quickly learn how to use Docker and containers in general to create packaged images for easy management, testing, and deployment of software.

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 }}