Skip to content

Instantly share code, notes, and snippets.

@kron4eg
Created May 29, 2009 19:49
Show Gist options
  • Save kron4eg/120170 to your computer and use it in GitHub Desktop.
Save kron4eg/120170 to your computer and use it in GitHub Desktop.
ssh_options[:forward_agent] = true
set :keep_releases, 2
set :application, "blabla.com"
set :repository, "git@blabla.com:myapp.git"
set :scm, :git
set :branch, "master"
set :user, "usename"
set :deploy_to, "/home/username/www/myapp/"
set :deploy_via, :remote_cache
set :rails_env, "production"
role :app, application
role :web, application
role :db, application, :primary => true
namespace :deploy do
db_config = YAML.dump(
"production" => {
"adapter" => "mysql",
"encoding" => "utf8",
"database" => "myapp_production",
"username" => "username",
"password" => "hehe"
}
)
task :start do
put(db_config, "/home/username/www/myapp/current/config/database.yml")
sudo "thin start -C /etc/thin/myapp-production.yml"
end
task :stop do
put(db_config, "/home/username/www/myapp/current/config/database.yml")
sudo "thin stop -C /etc/thin/myapp-production.yml"
end
task :restart do
put(db_config, "/home/username/www/myapp/current/config/database.yml")
sudo "thin restart -C /etc/thin/myapp-production.yml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment