Class: OpsPreflight::Server
- Inherits:
-
Thor
- Object
- Thor
- OpsPreflight::Server
- Includes:
- ExitCode
- Defined in:
- lib/ops_preflight/server.rb
Class Method Summary collapse
-
.banner(command, namespace = nil, subcommand = false) ⇒ Object
Fixes thor’s banners when used with :default namespace.
Instance Method Summary collapse
- #deploy(stack_name, app_name) ⇒ Object
- #download ⇒ Object
- #fetch_environment(environment, stack_name, app_name) ⇒ Object
- #upload ⇒ Object
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
Fixes thor’s banners when used with :default namespace
41 42 43 |
# File 'lib/ops_preflight/server.rb', line 41 def self.(command, namespace = nil, subcommand = false) "#{basename} #{command.formatted_usage(self, false, subcommand)}" end |
Instance Method Details
#deploy(stack_name, app_name) ⇒ Object
27 28 29 30 31 |
# File 'lib/ops_preflight/server.rb', line 27 def deploy(stack_name, app_name) require 'ops_preflight/ops_works/deploy.rb' OpsWorks::Deploy.new(stack_name, app_name).call([:release]) end |
#download ⇒ Object
20 21 22 23 |
# File 'lib/ops_preflight/server.rb', line 20 def download require 'ops_preflight/s3_transfer.rb' S3Transfer.new([:bucket], [:file]).download end |
#fetch_environment(environment, stack_name, app_name) ⇒ Object
34 35 36 37 38 |
# File 'lib/ops_preflight/server.rb', line 34 def fetch_environment(environment, stack_name, app_name) require 'ops_preflight/ops_works/fetch_environment.rb' OpsWorks::FetchEnvironment.new(environment, stack_name, app_name).call end |
#upload ⇒ Object
10 11 12 13 14 15 |
# File 'lib/ops_preflight/server.rb', line 10 def upload raise Thor::Error, "Specified file not found: #{[:file]}" unless File.exists?([:file]) require 'ops_preflight/s3_transfer.rb' S3Transfer.new([:bucket], [:file]).upload end |