Sha256: 29bd447577ff57a165848cad5325f5b874b1fa9c468215f7a77766e4434d5f5c

Contents?: true

Size: 532 Bytes

Versions: 9

Compression:

Stored size: 532 Bytes

Contents

require 'util'
require 'fileutils'
require 'thor/group'

class Start < Thor::Group
  include DockerMgr::Util

  argument :app_name,
    :required => false

  def start
    if @app_name
      start_app(@app_name)
    else
      Dir.entries(apps_dir)
         .select{|e| e != '.' && e != '..'} 
         .each(&method(:start_app))
    end
  end

  no_tasks do 
    def start_app(app_name)
      app_path = "#{apps_dir}/#{app_name}"
      FileUtils.cd app_path do
        puts `sudo docker-compose up -d`
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dockersitter-0.7.0 lib/commands/start.rb
dockersitter-0.6.0 lib/commands/start.rb
dockersitter-0.5.0 lib/commands/start.rb
dockersitter-0.4.0 lib/commands/start.rb
dockersitter-0.3.0 lib/commands/start.rb
dockersitter-0.2.2 lib/commands/start.rb
dockersitter-0.2.1 lib/commands/start.rb
dockersitter-0.2.0 lib/commands/start.rb
dockersitter-0.1.0 lib/commands/start.rb