The fastest way to deploy rail applications with Passenger

I am working on a Dreamhost server with Rails 2.3.5.

Every time I make changes to the site, I need ssh to the site, delete all files, upload a zip file containing all the new files for the site, unzip this file, transfer the database and go.

Something tells me a faster way to deploy rails applications. I use Mac Time Machine to track various versions of my applications. I know git track files, but I really don’t know how to work with it to deploy my applications, since the passenger takes care of me all the magic.

What will be a faster way to deploy my applications (and avoid the downtime associated with my method when deleting all files on the server)?

Thanks!

+4
source share
3 answers

And go to the aid of Capistrano: http://github.com/westarete/capistrano-helpers

Here's a simplified, annotated Deploy file for my own site.

require 'capistrano-helpers/branch' # prompts for branch require 'capistrano-helpers/passenger' # Support for Apache passenger require 'capistrano-helpers/version' # Record the version number after deploying require 'capistrano-helpers/privates' # handle sensitive files require 'capistrano-helpers/shared' set :application, "site" set :repository, "file://." set :scm, "git" set :branch, "rails3" set :deploy_via, :copy set :copy_exclude, [ ".git", "assets", "test", "Capfile", "vishvish.tmproj", "bin" ] set :deploy_to, "/blah/blah.com/#{application}" set :user, "blah" set :domain, "blah.com" #Things you want symlinked afterwards, not in version control. set :privates, %w{ config/database.yml } #Things you want shared across deployments, not uploaded every time. set :shared, %w{ uploads } role :app, domain role :web, domain role :db, domain, :primary => true namespace :deploy do desc "Restarting mod_rails with restart.txt" task :restart, :roles => :app, :except => { :no_release => true } do run "touch #{current_path}/tmp/restart.txt" end [:start, :stop].each do |t| desc "#{t} task is a no-op with mod_rails" task t, :roles => :app do ; end end end 
+1
source

Take a look at Capistrano .

+4
source

You definitely need git and capistrano.

My deployment process:

 git commit git push cap deploy 

Git is pretty straight forward. There are tons of resources and best practices on github.com. If you are not using a control source, you absolutely SHOULD fix this ...

+1
source

Source: https://habr.com/ru/post/1306652/


All Articles