Class: Picobox::CLI
- Inherits:
-
Thor
- Object
- Thor
- Picobox::CLI
- Includes:
- Utils::Output
- Defined in:
- lib/picobox/cli.rb
Instance Method Summary collapse
- #boxes ⇒ Object
- #init(box) ⇒ Object
- #install ⇒ Object
- #reset ⇒ Object
- #restart ⇒ Object
- #ssh(service) ⇒ Object
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
- #uninstall ⇒ Object
- #update ⇒ Object
- #version ⇒ Object
Methods included from Utils::Output
#display_error, #display_info, #display_line, #display_status
Instance Method Details
#boxes ⇒ Object
181 182 183 184 185 |
# File 'lib/picobox/cli.rb', line 181 def boxes() Box.new(Os::CurrentOs.get).list rescue SignalException exit 1 end |
#init(box) ⇒ Object
121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/picobox/cli.rb', line 121 def init(box) Picobox.set_verbosity [:verbose] os = Os::CurrentOs.get Project.new(os).init Box.new(os).install box Service.new(os).build System.new(os).start rescue SignalException exit 1 end |
#install ⇒ Object
88 89 90 91 92 93 |
# File 'lib/picobox/cli.rb', line 88 def install Picobox.set_verbosity [:verbose] System.new(Os::CurrentOs.get).install rescue SignalException exit 1 end |
#reset ⇒ Object
201 202 203 204 205 206 207 208 |
# File 'lib/picobox/cli.rb', line 201 def reset() display_info('Cleaning stopped containers', :green) display_status('execute', 'container prune') system "docker container prune" system "docker volume prune" rescue SignalException exit 1 end |
#restart ⇒ Object
160 161 162 163 164 165 |
# File 'lib/picobox/cli.rb', line 160 def restart() Picobox.set_verbosity [:verbose] System.new(Os::CurrentOs.get).restart rescue SignalException exit 1 end |
#ssh(service) ⇒ Object
171 172 173 174 175 |
# File 'lib/picobox/cli.rb', line 171 def ssh(service) System.new(Os::CurrentOs.get).ssh service rescue SignalException exit 1 end |
#start ⇒ Object
138 139 140 141 142 143 |
# File 'lib/picobox/cli.rb', line 138 def start() Picobox.set_verbosity [:verbose] System.new(Os::CurrentOs.get).start rescue SignalException exit 1 end |
#status ⇒ Object
191 192 193 194 195 |
# File 'lib/picobox/cli.rb', line 191 def status() system "docker-compose ps" rescue SignalException exit 1 end |
#stop ⇒ Object
149 150 151 152 153 154 |
# File 'lib/picobox/cli.rb', line 149 def stop() Picobox.set_verbosity [:verbose] System.new(Os::CurrentOs.get).stop rescue SignalException exit 1 end |
#uninstall ⇒ Object
110 111 112 113 114 115 |
# File 'lib/picobox/cli.rb', line 110 def uninstall Picobox.set_verbosity [:verbose] System.new(Os::CurrentOs.get).uninstall rescue SignalException exit 1 end |