Created
December 20, 2008 21:12
-
-
Save natebird/38430 to your computer and use it in GitHub Desktop.
multi stage production recipe for slicehost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################# | |
# Application | |
############################################################# | |
set :application, "app_name" | |
set :deploy_to, "/home/user/public_html/#{application}" | |
############################################################# | |
# Settings | |
############################################################# | |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true | |
set :use_sudo, true | |
set :scm_verbose, true | |
set :rails_env, "production" | |
############################################################# | |
# Servers | |
############################################################# | |
set :user, "user" | |
set :ssh_options, { :forward_agent => true } | |
set :port, "PORT#" | |
set :domain, "www.example.com" | |
server domain, :app, :web | |
role :db, domain, :primary => true | |
############################################################# | |
# Git | |
############################################################# | |
set :scm, :git | |
set :branch, "master" | |
# set :scm_user, 'user' | |
# set :scm_passphrase, "PASSWORD" | |
set :repository, "git@github.com:gituser/gitrepo.git" | |
set :deploy_via, :remote_cache | |
############################################################# | |
# Passenger | |
############################################################# | |
namespace :deploy do | |
desc "Create the database yaml file" | |
task :after_update_code do | |
db_config = <<-EOF | |
production: | |
adapter: mysql | |
encoding: utf8 | |
username: user | |
password: password | |
database: production | |
host: localhost | |
EOF | |
put db_config, "#{release_path}/config/database.yml" | |
# desc "Symlink the upload directories" | |
# task :before_symlink do | |
# run "mkdir -p #{shared_path}/uploads" | |
# run "ln -s #{shared_path}/uploads #{release_path}/public/uploads" | |
# end | |
end | |
############################################################# | |
# Passenger | |
############################################################# | |
# Restart passenger on deploy | |
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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment