Class: Kraaken::Cli::App
- Includes:
- Thor::Actions
- Defined in:
- lib/kraaken/cli/app.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#credentials ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/kraaken/cli/app.rb', line 11 def credentials old_content = new_content = app.environment.strip Tempfile.create(app.name) do |file| file.write old_content file.flush logger.info "Opening #{file.path}" run "code --wait #{file.path}" file.rewind new_content = file.read.strip end if new_content != old_content logger.info "Updating #{app.name} credentials" app.environment = new_content end end |
#deploy ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/kraaken/cli/app.rb', line 29 def deploy default_path = File.("config/deploy/docker-compose.yml", destination_root) file = File.new([:file]) if [:file].present? && File.exist?([:file]) file = File.new(default_path) if !file && File.exist?(default_path) logger.error "No docker-compose file found" and return unless file app.deploy(file) end |
#destroy ⇒ Object
38 39 40 |
# File 'lib/kraaken/cli/app.rb', line 38 def destroy app.destroy end |
#logs ⇒ Object
43 44 45 46 |
# File 'lib/kraaken/cli/app.rb', line 43 def logs app.logs rescue IOError # prevent error when terminating the cli end |