Sha256: cfbfbf61f6907423dfb8a257f8c47e4f71bab6879de458a5b5cab7bf2652b5a2
Contents?: true
Size: 1.8 KB
Versions: 4
Compression:
Stored size: 1.8 KB
Contents
module OpsPreflight class Server < Thor include ExitCode namespace :default desc "upload", "Upload preflight files to S3" option :bucket, :aliases => '-b', :required => true, :type => :string, :banner => "<s3_bucket>" option :file, :aliases => '-f', :required => true, :type => :string, :banner => "<file>" def upload raise Thor::Error, "Specified file not found: #{options[:file]}" unless File.exists?(options[:file]) require 'ops_preflight/s3_transfer.rb' S3Transfer.new(options[:bucket], options[:file]).upload end desc "download", "Downloads preflight files from S3" option :bucket, :aliases => '-b', :required => true, :type => :string, :banner => "<s3_bucket>" option :file, :aliases => '-f', :required => true, :type => :string, :banner => "<file>" def download require 'ops_preflight/s3_transfer.rb' S3Transfer.new(options[:bucket], options[:file]).download end desc "deploy <stack_name> <app_name>", "Deploys the application to opsworks" option :release, :type => :string, :banner => '<release number>' def deploy(stack_name, app_name) require 'ops_preflight/ops_works/deploy.rb' OpsWorks::Deploy.new('us-east-1', stack_name, app_name).call(options[:release]) end desc "fetch_environment <environment> <stack_name> <app_name>", 'Fetches environment variables from opsworks' def fetch_environment(environment, stack_name, app_name) require 'ops_preflight/ops_works/fetch_environment.rb' OpsWorks::FetchEnvironment.new(environment, 'us-east-1', stack_name, app_name).call end # Fixes thor's banners when used with :default namespace def self.banner(command, namespace = nil, subcommand = false) "#{basename} #{command.formatted_usage(self, false, subcommand)}" end end end
Version data entries
4 entries across 4 versions & 1 rubygems