Class: Wakame::Command::DeployApplication

Inherits:
Object
  • Object
show all
Includes:
Wakame::Command, Service
Defined in:
lib/wakame/command/deploy_application.rb

Constant Summary

Constants included from Service

Service::Property, Service::STATUS_ENTERING, Service::STATUS_FAIL, Service::STATUS_INIT, Service::STATUS_MIGRATING, Service::STATUS_OFFLINE, Service::STATUS_ONLINE, Service::STATUS_QUITTING, Service::STATUS_RELOADING, Service::STATUS_RUNNING, Service::STATUS_STARTING, Service::STATUS_STOPPING, Service::STATUS_TERMINATE, Service::STATUS_UNKNOWN

Instance Method Summary collapse

Methods included from Wakame::Command

included, #options=, #params

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/wakame/command/deploy_application.rb', line 8

def run
  raise "Invalid application name: \"#{params['app_name']}\"" if params['app_name'].nil? || params['app_name'] !~ /\A[\w\-\.\@]+\Z/
  if Wakame::Models::ApplicationRepository.find(:app_name=>params['app_name']) == nil
    raise "The name of application is not registered: #{params['app_name']}"
  end

  
  trigger_action(Wakame::Actions::DeployApplication.new(params['app_name']))
end