background preloader

Déploiement

Facebook Twitter

Koppen/redmine_github_hook. How to Deploy a Rails 4 App With Git and Capistrano // Rob McLarty. I think the two key aspects of any deployment process are speed and consistency. Speed means you can iterate and fix bugs fast and keep your production code in sync with your development code. Consistency means you know it's going to do the same thing every time so you're not afraid to actually do it and stay up to date.

Using a revision control system like Git along with automated deployment recipes with Capistrano satisfies these criteria easily and gives your Rails app a little more oomph. This article assumes you're using a setup like I outlined in my article on how to setup a production server. That is, a Unix server with SSH access using Phusion Passenger and Apache serving a Ruby on Rails app. Knowing is half the battle Back when I was first learning Rails as a wide-eyed noob, I had no idea how to get from this thing that was working on my dev machine onto a real web server that other people could actual use.

Well, there is and there isn't. Your App rake db:migrate rails s or Capify. How to Setup a Production Server for Rails 4 // Rob McLarty. Choose a Service Provider I already had an account with Media Temple, so I thought that keeping all my cloud junk together and staying with MT would make things easier to manage, for me personally. I'm not getting paid to endorse MT in any way. Without my existing relationship I could have just as easily gone with something like Rackspace, Linode, or even Heroku. I was previously using MT's DV server which is a pre-installed setup that comes with a custom CentOS and Plex configuration. So for my production server (the one running this blog) I chose to go with Media Temple's VE server.

Install an Operating System My choice of OS was Ubuntu 11.04 (although I would have preferred 12.04.2 LTS, but 11.04 is the newest version of Ubuntu MT offers). The following are the steps I took to get from brand-new Ubuntu install from Media Temple's account centre through to a working Ruby 2.0 on Rails 4.beta app running on Apache 2 and Phusion Passenger 4.rc4 (rc6 just came out as I'm writing this). or.

Configuration d’Apache avec Passenger pour Rails 3. Ubuntu - Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v. Phusion Passenger users guide, Apache version. 2.1. Synopsis Because Phusion Passenger is designed to run in a wide variety of operating systems and configurations, there are multiple ways to install it. Most users — especially first-time users — will prefer OS-specific installation instructions. These are not only the easiest, but also allow Phusion Passenger to integrate into the operating system in the best way possible. Other users should consult the generic installation instructions.

The steps for upgrading or downgrading Phusion Passenger is almost the same as the steps for installing. 2.3. We provide an official Phusion Passenger APT repository. If you use these packages to install Phusion Passenger then you do not need to run passenger-install-apache2-module or passenger-install-nginx-module. Packages are available for the x86 and x86_64 architectures. 2.3.1. Install our PGP key. 2.3.2. Open source Enterprise Download your license key from the Customer Area and save it as /etc/passenger-enterprise-license. 2.4. 2.5. Open Source. How to Setup a Production Server for Rails 4 // Rob McLarty. How to Deploy a Rails 4 App With Git and Capistrano // Rob McLarty. Deploy Rails 3 Unicorn applications using Capistrano on a shared web host non-root - Muriel's Tech Blog. In my struggle to have complete Rails3 environments setup in shared web hosts, the deployment step was missing.

Lately I managed to deploy Rails3 Unicorn applications using Capistrano on a shared web host, as a non-root user with very limited privileges (jailshell). So I decided to share this with you. For information, here are the versions used: On my development host (from where I issue cap commands) [Windows 7 64bits]: Ruby: 1.9.3p194RubyGems: 1.8.24Bundler: 1.2.4Rails: 3.2.12Capistrano: 2.14.2capistrano-unicorn: master branch from GitHub repositoryOn my production environment [Linux i686]: Ruby: 1.8.7p370RubyGems: 1.6.2Bundler: 1.2.4Unicorn: 4.6.0 Here are some prerequisites for this tutorial: For the sake of this tutorial, the production host is called “mysite.com”, the SSH connection is made on port “1234″, the user running everything is named “myuser”.

Here are all the steps: First thing is to setup a git repository on the remote production host. . And that's it! Gestion des configurations entre les différents environnements - Social Reviewing. Back To Project Afin de gérer les différences entre les environnements, j'ai voulu regrouper les variables de configuration. Étant donné que mon code est open-source, je souhaitais avoir les configurations de mon environnement de production dans un fichier séparé afin de pouvoir l'ignorer lors de mes commits. Les modifications apportées se trouvent dans ce commit : . Tout d'abord, j'ai créé une classe capable de lire un fichier et de retourner le paramètre souhaité. require 'yaml' class SRConfig class << self def method_missing(name) if config.include? Name.to_s.upcase return config[name.to_s.upcase] else super(name) end end def config @config ||= YAML.load_file("#{Rails.root}/config/config.

#{Rails.env}.yml") end end end Cette classe est relativement simple. Suite à ça, j'ai créé un fichier pour chaque environnement comme ceci : et j'ai extrait tous les paramètres de mon application. Et voilà!