From 889799c14324fbfb783a6e57dd8bfa5615670925 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Wed, 11 Mar 2009 20:34:05 +0000 Subject: [PATCH] Fixed cap deploy file for Passenger; added migration to create an admin user --- config/deploy.rb | 31 ++++++++++++++----- .../20090311202750_add_first_admin_user.rb | 12 +++++++ db/schema.rb | 2 +- 3 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20090311202750_add_first_admin_user.rb diff --git a/config/deploy.rb b/config/deploy.rb index 1c6433a..7fd1759 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -38,20 +38,37 @@ end # end #end -# Custom tasks for starting and restarting Mongrel cluster + ## Custom tasks for starting and restarting Mongrel cluster +#namespace :deploy do +# desc "start the mongrel cluster" +# task :start, :roles => :app do +# sudo "/usr/bin/mongrel_cluster_ctl start" +# end +# +# desc "stop the mongrel cluster" +# task :stop, :roles => :app do +# sudo "/usr/bin/mongrel_cluster_ctl stop" +# end +# +# desc "restart the mongrel cluster" +# task :restart, :roles => :app do +# sudo "/usr/bin/mongrel_cluster_ctl restart" +# end +#end + namespace :deploy do - desc "start the mongrel cluster" task :start, :roles => :app do - sudo "/usr/bin/mongrel_cluster_ctl start" end - desc "stop the mongrel cluster" task :stop, :roles => :app do - sudo "/usr/bin/mongrel_cluster_ctl stop" end - desc "restart the mongrel cluster" + desc "Restart Application" task :restart, :roles => :app do - sudo "/usr/bin/mongrel_cluster_ctl restart" + run "touch #{release_path}/tmp/restart.txt" end + +# task :after_update_code, :roles => :app do +# run "rm -rf #{release_path}/public/.htaccess" +# end end diff --git a/db/migrate/20090311202750_add_first_admin_user.rb b/db/migrate/20090311202750_add_first_admin_user.rb new file mode 100644 index 0000000..4f73459 --- /dev/null +++ b/db/migrate/20090311202750_add_first_admin_user.rb @@ -0,0 +1,12 @@ +class AddFirstAdminUser < ActiveRecord::Migration + def self.up + User.delete_all + User.create(:name => 'Neil', + :password => 'neildepot', + :password_confirmation => 'neildepot') + end + + def self.down + User.delete_all + end +end diff --git a/db/schema.rb b/db/schema.rb index 6b870e1..53e465e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20090311105014) do +ActiveRecord::Schema.define(:version => 20090311202750) do create_table "line_items", :force => true do |t| t.integer "product_id", :null => false -- 2.34.1