Module: Scud::Provisioner::Capistrano

Defined in:
lib/scud/provisioner/capistrano.rb

Class Method Summary collapse

Class Method Details

.bootstrap(opts = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/scud/provisioner/capistrano.rb', line 8

def self.bootstrap(opts={})
  config = ::Capistrano::Configuration.new
  config.logger.level = ::Capistrano::Logger::TRACE
  bootstrapname = find_bootstrap(opts[:bootstrapname])
  unless bootstrapname
    puts "No provisioning tasks found - #{opts[:bootstrapname]}"
    exit 1
  end
  config.load bootstrapname

  config.default_run_options[:pty] = true

  ENV['HOSTS'] = opts[:dns_name]

  puts "\nbootstrapping #{ENV['HOSTS']}....."
  config.bootstrap
end