Sha256: 66246c93cdc6f313e47c54dd19b979fc604e05dcfbafd3284c262062a6a7b8f9

Contents?: true

Size: 676 Bytes

Versions: 14

Compression:

Stored size: 676 Bytes

Contents

require "thor"

module Dogids
  class Cli < Thor
    no_commands do
      def ssh_production(vm_name = nil)
        production_machines = get_config_url("production")
        if production_machines.has_key?(vm_name)
          ssh_address = get_config_url("production",vm_name)
          if vm_name == "lb" || vm_name == "railgun"
            puts "Running: `ssh root@#{ssh_address}`"
            exec("ssh root@#{ssh_address}")
          else
            puts "Running: `ssh -R 52698:localhost:52698 dogids@#{ssh_address}`"
            exec("ssh -R 52698:localhost:52698 dogids@#{ssh_address}")
          end
        else
          ssh
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dogids-cli-0.0.33 lib/dogids/ssh/production.rb
dogids-cli-0.0.32 lib/dogids/ssh/production.rb
dogids-cli-0.0.31 lib/dogids/ssh/production.rb
dogids-cli-0.0.30 lib/dogids/ssh/production.rb
dogids-cli-0.0.29 lib/dogids/ssh/production.rb
dogids-cli-0.0.28 lib/dogids/ssh/production.rb
dogids-cli-0.0.27 lib/dogids/ssh/production.rb
dogids-cli-0.0.26 lib/dogids/ssh/production.rb
dogids-cli-0.0.25 lib/dogids/ssh/production.rb
dogids-cli-0.0.24 lib/dogids/ssh/production.rb
dogids-cli-0.0.23 lib/dogids/ssh/production.rb
dogids-cli-0.0.22 lib/dogids/ssh/production.rb
dogids-cli-0.0.21 lib/dogids/ssh/production.rb
dogids-cli-0.0.20 lib/dogids/ssh/production.rb