Browse files

Cleaned up the before/after hooks and cap tasks a bit:

1. Stop using deploy:cold
2. Removed the db:optimize hook (if it should be run on setup then it should be part of the ec2onrails:setup task, but it's untested right now and I'm reluctant to add it to the default setup until someone can confirm that it works)
3. run ec2onrails:db:init_backup after creating the db
4. removed the add_gem_sources task, gem dependencies in recent versions of Rails can specify a source
5. purge the proxy cache after redeploying
  • Loading branch information...
1 parent 9a9bab5 commit 68d6b9f39a2111ecba7a1bc39ca8c2f1731fe157 @pauldowman committed Oct 22, 2009
Showing with 5 additions and 19 deletions.
  1. +2 −1 README.textile
  2. +3 −4 gem/lib/ec2onrails/recipes.rb
  3. +0 −14 gem/lib/ec2onrails/recipes/server.rb
@@ -106,7 +106,8 @@ h4. 5. Deploy the app with Capistrano
Now that the gem is installed, your deploy.rb is configured and you can start and stop EC2 instances, this is the only thing you'll need to do from now on.
-cap deploy:cold
+cap ec2onrails:setup
+cap deploy:migrations
Yes, it's that easy! The setup task will set the server's timezone, install any gems and Ubuntu packages that you specified in the config file, and create your database.
@@ -48,13 +48,12 @@
set :use_sudo, false
set :user, "app"
- #in case any changes were made to the configs
+ # in case anyone is still using deploy:cold
before "deploy:cold", "ec2onrails:setup"
after "deploy:symlink", "ec2onrails:server:set_roles", "ec2onrails:server:init_services"
- after "deploy:cold", "ec2onrails:db:init_backup", "ec2onrails:db:optimize", "ec2onrails:server:restrict_sudo_access"
- # TODO I don't think we can do gem source -a every time because I think it adds the same repo multiple times
- after "ec2onrails:server:install_gems", "ec2onrails:server:add_gem_sources"
+ after "deploy:symlink", "ec2onrails:server:purge_proxy_cache"
+ after "ec2onrails:db:create", "ec2onrails:db:init_backup"
on :load do
before "deploy:symlink", "ec2onrails:server:run_rails_rake_gems_install"
@@ -280,20 +280,6 @@
desc <<-DESC
- Add extra gem sources to rubygems (to able to fetch gems from for example
- Set ec2onrails_config[:rubygems_sources], it should be with an array of strings.
- task :add_gem_sources do
- if cfg[:rubygems_sources]
- allow_sudo do
- cfg[:rubygems_sources].each do |gem_source|
- sudo "gem sources -a #{gem_source}"
- end
- end
- end
- end
- desc <<-DESC
A convenience task to upgrade existing packages and gems and install \
specified new ones.

0 comments on commit 68d6b9f

Please sign in to comment.