Class: Shipitron::CLI
- Inherits:
-
Thor
- Object
- Thor
- Shipitron::CLI
- Defined in:
- lib/shipitron/cli.rb
Instance Method Summary collapse
- #bootstrap(app) ⇒ Object
- #deploy(app) ⇒ Object
- #force_deploy(app) ⇒ Object
- #server_deploy ⇒ Object
- #version ⇒ Object
Instance Method Details
#bootstrap(app) ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/shipitron/cli.rb', line 128 def bootstrap(app) setup( secrets_file: [:secrets_file] ) require 'shipitron/client/bootstrap_application' result = Client::BootstrapApplication.call( application: app, region: [:region], cluster_name: [:cluster_name], service_count: [:service_count], task_def_directory: [:task_def_dir], service_directory: [:service_dir] ) if result.failure? result..each do |error| Logger.fatal error end Logger.fatal 'Bootstrap failed.' end end |
#deploy(app) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/shipitron/cli.rb', line 17 def deploy(app) setup( config_file: [:config_file], secrets_file: [:secrets_file] ) require 'shipitron/client/deploy_application' result = Client::DeployApplication.call( application: app, simulate: [:simulate] ) if result.failure? result..each do |error| Logger.fatal error end Logger.fatal 'Deploy failed.' end end |
#force_deploy(app) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/shipitron/cli.rb', line 41 def force_deploy(app) setup( config_file: [:config_file], secrets_file: [:secrets_file] ) require 'shipitron/client/force_deploy' result = Client::ForceDeploy.call( application: app ) if result.failure? result..each do |error| Logger.fatal error end Logger.fatal 'Deploy failed.' end end |
#server_deploy ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/shipitron/cli.rb', line 81 def server_deploy setup( secrets_file: [:secrets_file] ) require 'shipitron/server/transform_cli_args' cli_args = Server::TransformCliArgs.call!( application: [:name], repository_url: [:repository], repository_branch: [:repository_branch], registry: [:registry], s3_cache_bucket: [:bucket], build_cache_location: [:build_cache_location], image_name: [:image_name], named_tag: [:named_tag], skip_push: [:skip_push], region: [:region], clusters: [:clusters], ecs_task_defs: [:ecs_task_defs], ecs_task_def_templates: [:ecs_task_def_templates], ecs_services: [:ecs_services], ecs_service_templates: [:ecs_service_templates], build_script: [:build_script], post_builds: [:post_builds] ).cli_args require 'shipitron/server/deploy_application' result = Server::DeployApplication.call( cli_args ) if result.failure? result..each do |error| Logger.fatal error end Logger.fatal 'Deploy failed.' end end |