diff --git a/deploy.rb.example b/deploy.rb.example index 4fe5bda..eaeea3e 100644 --- a/deploy.rb.example +++ b/deploy.rb.example @@ -15,6 +15,7 @@ set :deploy_to, "/home/#{user}/#{application}/" # where you want the app deploye # set :use_sudo, false # Uncomment if eg you run on a shared host like DreamHost # ssh_options[:keys] = %w(~/.ssh/sekrit_deploy_key) # You really should use public keys. It's much easier. Make sure it works on your repo too. # ssh_options[:port] = 25 +# set :default_environment, :PATH => "$PATH:/your/custom/ruby/path" # Uncomment if you use a non standard ruby bin PATH (eg when using rvm or ruby enterprise edition) # set :ip, '##.##.##.##' # IP of repository. Better than using DNS lookups, if it's static # :no_release => true means that no code will be deployed to that box (but non-code tasks may run on it) diff --git a/install.rb b/install.rb index c1e1617..34a0e85 100644 --- a/install.rb +++ b/install.rb @@ -4,6 +4,10 @@ example_deploy = File.join(File.dirname(__FILE__), 'deploy.rb.example') real_deploy = File.join(RAILS_ROOT, 'config', 'deploy.rb') real_example = File.join(RAILS_ROOT, 'config', 'deploy.rb.example') +gemfile = File.join(RAILS_ROOT, 'Gemfile') +capfile = File.join(RAILS_ROOT, 'Capfile') + +capify_cmd = "capify #{RAILS_ROOT}" if !File.exists? real_deploy FileUtils.cp example_deploy, real_deploy @@ -12,7 +16,16 @@ FileUtils.cp example_deploy, real_example puts "SuperDeploy installed. Please edit config/deploy.rb.example" else - puts "You already have a config/deploy.rb.example file..." + puts "You already have both config/deploy.rb and config/deploy.rb.example file..." end -exec "capify #{RAILS_ROOT}" \ No newline at end of file +capified_ok = system(capify_cmd) + +if capified_ok + open(capfile, 'a') do |f| + yes_require = "\nrequire 'bundler/capistrano'" + no_require = "\n# require 'bundler/capistrano' # Uncomment this in case you want to use bundler deploy tasks" + + f << (File.exists?(gemfile) ? yes_require : no_require) + end +end diff --git a/recipes/apt.rb b/recipes/apt.rb index f582f4b..a2a276e 100644 --- a/recipes/apt.rb +++ b/recipes/apt.rb @@ -8,7 +8,7 @@ desc "Runs aptitude upgrade on remote server" task :upgrade do - sudo_with_input "aptitude upgrade", /^Do you want to continue\?/ + sudo "aptitude upgrade" end desc "Search for aptitude packages on remote server" @@ -28,7 +28,7 @@ logger.info "Updating packages..." sudo "aptitude update" logger.info "Installing #{deb_pkg_name}..." - sudo_with_input "aptitude install #{deb_pkg_name}", /^Do you want to continue\?/ + sudo "aptitude install #{deb_pkg_name}" end end end \ No newline at end of file