Class: Pulsar::CLI
- Inherits:
-
Thor
- Object
- Thor
- Pulsar::CLI
- Defined in:
- lib/pulsar/cli.rb
Instance Method Summary collapse
- #__print_version ⇒ Object
- #deploy(application, environment) ⇒ Object
- #install(directory = './pulsar-conf') ⇒ Object
- #list ⇒ Object
Instance Method Details
#__print_version ⇒ Object
67 68 69 |
# File 'lib/pulsar/cli.rb', line 67 def __print_version puts Pulsar::VERSION end |
#deploy(application, environment) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/pulsar/cli.rb', line 51 def deploy(application, environment) load_config result = Pulsar::Deploy.call( repository: load_option_or_env!(:conf_repo), application: application, environment: environment ) if result.success? puts "Deployed #{application} on #{environment}!" else puts "Failed to deploy #{application} on #{environment}." puts result.error end end |
#install(directory = './pulsar-conf') ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pulsar/cli.rb', line 13 def install(directory = './pulsar-conf') result = Pulsar::Install.call(directory: directory) if result.success? puts 'Successfully created intial repo!' else puts 'Failed to create intial repo.' puts result.error end end |
#list ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pulsar/cli.rb', line 30 def list load_config result = Pulsar::List.call(repository: load_option_or_env!(:conf_repo)) if result.success? result.applications.each do |app, stages| puts "#{app}: #{stages.join(', ')}" end else puts 'Failed to list application and environments.' puts result.error end end |