Class: Dockerploy::CLI
- Inherits:
-
Thor
- Object
- Thor
- Dockerploy::CLI
- Defined in:
- lib/dockerploy/cli.rb
Overview
The command-line interface for Dockerploy
Instance Method Summary collapse
- #build ⇒ Object
- #deploy(environment) ⇒ Object
-
#initialize(args = [], opts = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #ps(environment) ⇒ Object
- #pull(environment) ⇒ Object
- #push ⇒ Object
Constructor Details
#initialize(args = [], opts = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
13 14 15 |
# File 'lib/dockerploy/cli.rb', line 13 def initialize(args = [], opts = {}, config = {}) super(args, opts, config) end |
Instance Method Details
#build ⇒ Object
28 29 30 |
# File 'lib/dockerploy/cli.rb', line 28 def build Image.new(configuration).build end |
#deploy(environment) ⇒ Object
43 44 45 46 |
# File 'lib/dockerploy/cli.rb', line 43 def deploy(environment) config = configuration(environment.to_sym) Deploy.new(config).deploy end |
#ps(environment) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/dockerploy/cli.rb', line 18 def ps(environment) config = configuration(environment.to_sym) return unless config.servers config.servers.each do |server| ssh_client = SSHClient.new(server[:host], server[:username], server[:password], server[:port]) ssh_client.command(sprintf('docker ps | grep %s', config.application_name)) end end |