Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy.rb.example
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 15 additions & 2 deletions install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
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
4 changes: 2 additions & 2 deletions recipes/apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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