Skip to content

Instantly share code, notes, and snippets.

@nathany
Created September 22, 2010 01:09
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 nathany/590920 to your computer and use it in GitHub Desktop.
Save nathany/590920 to your computer and use it in GitHub Desktop.
require 'vlad/passenger'
set :application, 'myapp'
set :user, 'deploy'
set :domain, "#{user}@10.0.0.10"
set :deploy_to, '/home/deploy/production/myapp'
set :repository, 'git@github.com:yardstick/myapp.git'
set :web_command, "/etc/init.d/httpd" #redhat doesn't use apachectl
namespace :vlad do
desc "setup apache configuration (assuming I had permission)"
remote_task :symlink_apache do
# sudo "" - must have tty
run "ln -fs #{current_path}/config/000-myapp.conf /home/deploy/apache/sites-available/000-myapp.conf"
run "ln -fs /home/deploy/apache/sites-available/000-myapp.conf /home/deploy/apache/sites-enabled/000-myapp.conf"
end
desc "copy system files not in git to shared folder"
task :deploy_system do
sh "scp -r public/system/* #{domain}:#{shared_path}/system/"
end
end
desc "Full deployment cycle"
task "vlad:deploy" => %w[vlad:update vlad:start_app vlad:cleanup]
require 'rake'
begin
require 'vlad'
Vlad.load :scm => :git, :app => nil # use git, don't use mongrel
rescue LoadError
# do nothing (vlad/vlad-git not requird on server,
# unfortunately this hides the error if vlad-git isn't installed locally)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment