lib/deprec/recipes/deprec.rb in isaac-deprec-1.99.30 vs lib/deprec/recipes/deprec.rb in isaac-deprec-1.99.32

- old
+ new

@@ -25,40 +25,43 @@ # to configure, build and install the service SRC_PACKAGES = {} unless defined?(SRC_PACKAGES) # Server options CHOICES_WEBSERVER = [:nginx, :apache, :none] - CHOICES_APPSERVER = [:mongrel, :webrick, :none] - CHOICES_DATABASE = [:mysql, :postgres, :none] + CHOICES_APPSERVER = [:mongrel, :webrick, :passenger, :none] + CHOICES_DATABASE = [:mysql, :postgresql, :sqlite, :none] - - # Server defaults - default :web_server_type, :apache + # Service defaults + # + # The defaults below are legacy values to support older deployments. + # Newly generated deploy.rb files have use apache, passenger and ree + default :passenger_use_ree, false + default :web_server_type, :nginx default :app_server_type, :mongrel default :db_server_type, :mysql + # + # default(:web_server_type) do + # Capistrano::CLI.ui.choose do |menu| + # CHOICES_WEBSERVER.each {|c| menu.choice(c)} + # menu.header = "select webserver type" + # end + # end + # + # default(:app_server_type) do + # Capistrano::CLI.ui.choose do |menu| + # CHOICES_APPSERVER.each {|c| menu.choice(c)} + # menu.header = "select application server type" + # end + # end + # + # default(:db_server_type) do + # Capistrano::CLI.ui.choose do |menu| + # CHOICES_DATABASE.each {|c| menu.choice(c)} + # menu.header = "select database server type" + # end + # end - default(:web_server_type) do - Capistrano::CLI.ui.choose do |menu| - CHOICES_WEBSERVER.each {|c| menu.choice(c)} - menu.header = "select webserver type" - end - end - - default(:app_server_type) do - Capistrano::CLI.ui.choose do |menu| - CHOICES_APPSERVER.each {|c| menu.choice(c)} - menu.header = "select application server type" - end - end - - default(:db_server_type) do - Capistrano::CLI.ui.choose do |menu| - CHOICES_DATABASE.each {|c| menu.choice(c)} - menu.header = "select database server type" - end - end - default(:application) do Capistrano::CLI.ui.ask "enter name of project(no spaces)" do |q| q.validate = /^[0-9a-z_]*$/ end end @@ -97,19 +100,19 @@ default(:group_src) { group } # group ownership for src dir default :src_dir, '/usr/local/src' # 3rd party src on servers lives here default(:web_server_aliases) { domain.match(/^www/) ? [] : ["www.#{domain}"] } # XXX for some reason this is causing "before deprec:rails:install" to be executed twice - # on :load, 'deprec:connect_canonical_tasks' + on :load, 'deprec:connect_canonical_tasks' namespace :deprec do - task :connect_canonical_tasks, :hosts => 'localhost' do + task :connect_canonical_tasks do # link application specific recipes into canonical task names # e.g. deprec:web:restart => deprec:nginx:restart metaclass = class << self; self; end [:web, :app, :db].each do |server| - server_type = send("#{server}_server_type") + server_type = send("#{server}_server_type").to_sym if server_type != :none metaclass.send(:define_method, server) { namespaces[server] } self.namespaces[server] = deprec.send(server_type) end end