Here is my recipe for the merb book.

set :application, "app"
set :repository,  "git://github.com/mattetti/app.git"

# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "~/merb-apps/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:
set :scm, :git
set :git_shallow_clone,     1
set :git_enable_submodules, 1
set :deploy_via,            :remote_cache
set :repository_cache,      "#{application}-src"
set :ssh_options,           :forward_agent => true
set :keep_releases,         3
set :use_sudo,              false

set :user,                  "mattetti"
# set :password,              ""

# comment out if it gives you trouble. newest net/ssh needs this set.
ssh_options[:paranoid] = false

role :app, "18.47.26.192"
role :web, "18.47.26.192"
role :db,  "18.47.26.192", :primary => true

#
# ==== Merb variables
#

set :merb_adapter,     "mongrel"
set :merb_environment, ENV["MERB_ENV"] || "production"
set :merb_port,        5500
set :merb_servers,     3

after "deploy:update_code", "symlink:symgem"
after "symlink:symgem","deploy:native_gems"
after "deploy:symlink", "deploy:add_timestamp"

namespace :symlink do
  desc "symlinks gems/gems"
  task :symgem, :roles => :app do
    run "ln -s #{shared_path}/gems/gems #{latest_release}/gems/gems"
  end
end

namespace :deploy do

  # nginx -c ~/etc/nginx.conf

  desc "stops application server"
  task :stop do
    run "cd #{latest_release}; bin/merb -K all"
  end

  desc "starts application server"
  task :start do
    run "cd #{latest_release}; bin/merb -a #{merb_adapter} -p #{merb_port}
-c #{merb_servers} -e #{merb_environment}"
  end

  desc "recompile native gems"
  task :native_gems do
    run "cd #{latest_release};bin/thor merb:gem:redeploy"
  end

  desc "restarts application server(s)"
  task :restart do
    deploy.stop
    deploy.start
  end

  desc "Restart apache"
  task :restart_apache, :roles => :web do
    sudo "svcadm restart apache"
  end

  desc "add a timestamp"
  task :add_timestamp do
    run "cd #{latest_release}; ./bin/rake add_timestamp"
  end

end

On Wed, Jan 21, 2009 at 4:53 PM, Carl Porth <[email protected]> wrote:

>
> How can one use the bundled version of thor to redeploy your gems when
> in order to use a bundled gem it has to be redeployed?  (That was a
> mouthful.)  Seems like a chicken/egg sort of problem.  What best
> practice should I be using?
>
> Thanks,
> Carl
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to