Sha256: 96b237124fb68304904aca36eccd2e3dc0078a21c1021241e8472db8d1d6e99e

Contents?: true

Size: 1.05 KB

Versions: 58

Compression:

Stored size: 1.05 KB

Contents

require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
require 'json'
require 'active_support/core_ext/hash/indifferent_access'

module MobileWorkflow::Cli
  class AppServerCleaner < Thor    
    class_option :version, type: :boolean, aliases: "-v", desc: "Show version number and quit"
    class_option :help, type: :boolean, aliases: '-h', desc: "Show this help message and quit"
    
    class_option :heroku, type: :boolean, default: false, desc: "Clean Heroku app"
    class_option :s3_storage, type: :boolean, default: false, desc: "Clean an s3 backend for attachment upload and storage"
    class_option :aws_region, type: :string, default: 'us-east-1', desc: "Specify a region to create AWS resources in"

    default_task :clean

    desc "rails destroy:app_server APP_NAME", "Destroy App server"
    def clean(app_name)
      `rm -rf #{app_name}`
      AwsBackend.new(app_name: app_name, region: options[:aws_region]).destroy if options[:s3_storage]
      HerokuBackend.new(app_name: app_name).destroy if options[:heroku]
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
mobile_workflow-0.10.2 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.10.1 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.10.0 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.9.0 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.8.9 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.9 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.8 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.7 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.6 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.5 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.4 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.3 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.2 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.1 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.7.0 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.6.31 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.6.30 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.6.29 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.6.28 lib/mobile_workflow/cli/app_server_cleaner.rb
mobile_workflow-0.6.27 lib/mobile_workflow/cli/app_server_cleaner.rb