Class: Appfront::Command::Deploys
- Defined in:
- lib/appfront/command/deploys.rb
Class Method Summary collapse
- .add(args, opts) ⇒ Object
- .info(opts) ⇒ Object
- .list ⇒ Object
- .rm(args, opts) ⇒ Object
- .update(args, opts) ⇒ Object
- .yaml(opts) ⇒ Object
Class Method Details
.add(args, opts) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/appfront/command/deploys.rb', line 13 def self.add(args, opts) spinner "Uploading Deploy YAML configuration to Jarvis..." do api.post "/flow.yaml", file: args[0] end puts "\n" end |
.info(opts) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/appfront/command/deploys.rb', line 35 def self.info(opts) find_deploy! opts h = api.get "/flow/#{@deploy}" puts "=== Deploy: #{h['name']}" puts puts "\t Deploy uuid: #{h['uuid']}" puts "\t Status: #{h['status']} " puts "\t Running deploys: #{h['deploys']}" if h['domains'] puts puts "=== Domains:" h['domains'].each do |domain| puts "\t #{domain['name']}" end end puts puts "=== Cluster: " puts "\t name: #{h['cluster_name']}" puts "\t uuid: #{h['cluster']}" puts "\t dns address:\t#{h['cluster_dns']}" if h['boxes'] h['boxes'].each do |box| puts "\t box address:\t#{box['box']}" end end if h['routes'] and h['routes'] != '' puts "\n" puts "=== Internal Addressing:" h['routes'].each do |r| puts "\t Route: #{r['route'].split('-')[0]} -> #{r['route'].split('-')[1]}" end end puts "\n" end |
.list ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/appfront/command/deploys.rb', line 80 def self.list deploys = api.get "/flows" unless deploys.count == 0 puts '=== Deploys List' deploys.each do |deploy| chars = 30 - deploy['name'].chars.count output = "#{deploy['name']}" for i in 0..chars output = output + ' ' end output = output + "---> status: #{deploy['status']}" puts output end else puts '=== You have no deploys.' end puts "\n" end |
.rm(args, opts) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/appfront/command/deploys.rb', line 27 def self.rm(args, opts) find_deploy! opts spinner "Removing Deploy..." do api.delete "/flow/#{@deploy}" end puts "\n" end |
.update(args, opts) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/appfront/command/deploys.rb', line 20 def self.update(args, opts) spinner "Updating Deploy YAML configuration to Jarvis..." do api.put "/flow.yaml", file: args[0] end puts "\n" end |
.yaml(opts) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/appfront/command/deploys.rb', line 3 def self.yaml(opts) find_deploy! opts spinner "Retrieving YAML configuration from Jarvis..." do @file = api.get "/flow/#{@deploy}/yaml" end puts "\nYAML file starts from here: \n\n" puts @file print "\n" end |