Class: Automan::Cli::Stalker

Inherits:
Base
  • Object
show all
Defined in:
lib/automan/cli/stalker.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?, #version

Instance Method Details

#aliasObject



23
24
25
# File 'lib/automan/cli/stalker.rb', line 23

def alias
  Automan::Beanstalk::Router.new(options).run
end

#create_appObject



95
96
97
# File 'lib/automan/cli/stalker.rb', line 95

def create_app
  Automan::Beanstalk::Application.new(options).create
end

#create_configObject



133
134
135
# File 'lib/automan/cli/stalker.rb', line 133

def create_config
  Automan::Beanstalk::Configuration.new(options).create
end

#cull_versionsObject



225
226
227
# File 'lib/automan/cli/stalker.rb', line 225

def cull_versions
  Automan::Beanstalk::Version.new(options).cull_versions(options[:number_to_keep])
end

#delete_appObject



106
107
108
# File 'lib/automan/cli/stalker.rb', line 106

def delete_app
  Automan::Beanstalk::Application.new(options).delete
end

#delete_configObject



176
177
178
# File 'lib/automan/cli/stalker.rb', line 176

def delete_config
  Automan::Beanstalk::Configuration.new(options).delete
end

#delete_versionObject



208
209
210
# File 'lib/automan/cli/stalker.rb', line 208

def delete_version
  Automan::Beanstalk::Version.new(options).delete
end

#deployObject



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/automan/cli/stalker.rb', line 65

def deploy
  # you must specify either a manifest file or both package and version label
  if options[:manifest].nil? &&
    (options[:version_label].nil? || options[:package].nil?)
    puts "Must specify either manifest or both version_label and package"
    help "deploy"
    exit 1
  end

  Automan::Beanstalk::Deployer.new(options).deploy
end

#packageObject



268
269
270
271
272
273
274
275
276
277
# File 'lib/automan/cli/stalker.rb', line 268

def package

  if !options[:manifest].nil? && options[:version_label].nil?
    puts "Must specify version_label when uploading manifest file"
    help "package"
    exit 1
  end

  Automan::Beanstalk::Package.new(options).upload_package
end

#show_versionsObject



236
237
238
239
240
241
242
243
244
245
246
# File 'lib/automan/cli/stalker.rb', line 236

def show_versions
  versions = Automan::Beanstalk::Version.new(options).versions
  versions.each do |v|
    tokens = [
      v[:application_name],
      v[:version_label],
      v[:date_created].iso8601
    ]
    say tokens.join("\t")
  end
end

#terminateObject



84
85
86
# File 'lib/automan/cli/stalker.rb', line 84

def terminate
  Automan::Beanstalk::Terminator.new(options).terminate
end

#update_configObject



160
161
162
# File 'lib/automan/cli/stalker.rb', line 160

def update_config
  Automan::Beanstalk::Configuration.new(options).update
end

#upload_configObject



192
193
194
# File 'lib/automan/cli/stalker.rb', line 192

def upload_config
  Automan::Beanstalk::Uploader.new(options).upload_config_templates
end