Skip to content

Instantly share code, notes, and snippets.

@elricstorm
Created June 12, 2011 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elricstorm/1021588 to your computer and use it in GitHub Desktop.
Save elricstorm/1021588 to your computer and use it in GitHub Desktop.
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
# // located in config/deploy.rb
# // This file you have to create yourself
default_run_options[:pty] = true
set :application, "yourdomain.com"
set :domain, "yourdomain.com"
set :repository, "git@github.com:YourUser/YourGit.git"
set :port, 30001 # your ssh port
set :use_sudo, true
set :deploy_to, "/home/user/public_html/production/#{application}" # set the path you want to deploy to
set :scm, "git"
set :user, "your Windows Or Linux User Name - the one that will have sudo or admin access"
set :scm_username, "your Github Username"
set :scm_passphrase, "your Github Password"
server "yourdomain.com", :app, :web, :db, :primary => true
set :branch, "master"
set :deploy_via, :remote_cache
namespace :deploy do
task :start, :roles => :app do
sudo "/etc/init.d/thin restart" # you can add and run any server commands here
end
task :stop, :roles => :app do
sudo "/etc/init.d/thin stop"
end
desc "Restart Application"
task :restart, :roles => :app do
sudo "/etc/init.d/thin restart"
end
end
=begin
cap deploy # Deploys your project.
cap deploy:check # Test deployment dependencies.
cap deploy:cleanup # Clean up old releases.
cap deploy:cold # Deploys and starts a `cold' application.
cap deploy:migrate # Run the migrate rake task.
cap deploy:migrations # Deploy and run pending migrations.
cap deploy:pending # Displays the commits since your last deploy.
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment