Class: Travis::CLI::Setup::EngineYard

Inherits:
Service
  • Object
show all
Defined in:
lib/travis/cli/setup/engine_yard.rb

Instance Attribute Summary

Attributes inherited from Service

#command

Instance Method Summary collapse

Methods inherited from Service

description, #initialize, known_as?, #method_missing, normalized_name, service_name

Constructor Details

This class inherits a constructor from Travis::CLI::Setup::Service

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Travis::CLI::Setup::Service

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/travis/cli/setup/engine_yard.rb', line 10

def run
  deploy 'provider' => 'engineyard' do |config|
    eyrc                  = File.expand_path(".eyrc", Dir.home)
    config['api_key']     = YAML.load_file(eyrc)["api_token"] if File.exists?(eyrc)
    config['api_key']     = ask("API token: ") { |q| q.echo = "*" }.to_s unless config['api_key']
    env                   = ask("Environment (optional): ").to_s
    config['environment'] = env unless env.empty?
    migrate               = agree("Run migrations on deploy? ") { |q| q.default = 'yes' }
    config['migrate']     = ask("Migration command: ") { |q| q.default = "rake db:migrate" } if migrate
  end
end