Class: EcsDeployCli::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ecs_deploy_cli/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/ecs_deploy_cli/cli.rb', line 5

def self.exit_on_failure?
  true
end

Instance Method Details

#deployObject



55
56
57
58
59
# File 'lib/ecs_deploy_cli/cli.rb', line 55

def deploy
  @parser = load(options[:file])
  runner.update_services! timeout: options[:timeout]
  runner.update_crons!
end

#deploy_scheduled_tasksObject



38
39
40
41
# File 'lib/ecs_deploy_cli/cli.rb', line 38

def deploy_scheduled_tasks
  @parser = load(options[:file])
  runner.update_crons!
end

#deploy_servicesObject



47
48
49
50
# File 'lib/ecs_deploy_cli/cli.rb', line 47

def deploy_services
  @parser = load(options[:file])
  runner.update_services! timeout: options[:timeout], service: options[:only]
end

#diffObject



19
20
21
22
# File 'lib/ecs_deploy_cli/cli.rb', line 19

def diff
  @parser = load(options[:file])
  runner.diff
end

#run_task(task_name) ⇒ Object



66
67
68
69
70
71
72
73
74
# File 'lib/ecs_deploy_cli/cli.rb', line 66

def run_task(task_name)
  @parser = load(options[:file])
  runner.run_task!(
    task_name,
    launch_type: options[:launch_type],
    security_groups: options[:security_groups].split(','),
    subnets: options[:subnets].split(',')
  )
end

#setupObject



31
32
33
34
# File 'lib/ecs_deploy_cli/cli.rb', line 31

def setup
  @parser = load(options[:file])
  runner.setup!
end

#sshObject



80
81
82
83
84
# File 'lib/ecs_deploy_cli/cli.rb', line 80

def ssh
  @parser = load(options[:file])
  ssh_options = { family: options[:task], service_name: options[:service] }.delete_if { |_, v| v.nil? }
  runner.ssh(**ssh_options)
end

#validateObject



11
12
13
14
15
# File 'lib/ecs_deploy_cli/cli.rb', line 11

def validate
  @parser = load(options[:file])
  runner.validate!
  puts 'Your ECSFile looks fine! 🎉'
end

#versionObject



25
26
27
# File 'lib/ecs_deploy_cli/cli.rb', line 25

def version
  puts "ECS Deploy CLI Version #{EcsDeployCli::VERSION}."
end