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
- #init ⇒ 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
17 18 19 |
# File 'lib/dockerploy/cli.rb', line 17 def initialize(args = [], opts = {}, config = {}) super(args, opts, config) end |
Instance Method Details
#build ⇒ Object
37 38 39 40 |
# File 'lib/dockerploy/cli.rb', line 37 def build = { tag: [:tag] } Image.new(configuration, ).build end |
#deploy(environment) ⇒ Object
55 56 57 58 59 |
# File 'lib/dockerploy/cli.rb', line 55 def deploy(environment) = { tag: [:tag] } config = configuration(environment.to_sym) Deploy.new(config, ).deploy end |
#init ⇒ Object
22 23 24 |
# File 'lib/dockerploy/cli.rb', line 22 def init Template.write end |
#ps(environment) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/dockerploy/cli.rb', line 27 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 |
#pull(environment) ⇒ Object
49 50 51 52 |
# File 'lib/dockerploy/cli.rb', line 49 def pull(environment) = { tag: [:tag] } Image.new(configuration(environment.to_sym), ).pull end |
#push ⇒ Object
43 44 45 46 |
# File 'lib/dockerploy/cli.rb', line 43 def push = { tag: [:tag] } Image.new(configuration, ).push end |