Sha256: b19a14a9d9767b06bbf50fbb3704c58a12068916e452c3f2e8e62036e921f25e

Contents?: true

Size: 1.42 KB

Versions: 28

Compression:

Stored size: 1.42 KB

Contents

module Inferno
  module CLI
    class Services < Thor
      no_commands do
        def base_command
          'docker-compose -f docker-compose.background.yml'
        end
      end

      desc 'start', 'Start background services'
      option :foreground,
             default: false,
             type: :boolean,
             desc: 'Run services in foreground'
      def start
        command = "#{base_command} up"
        command += ' -d' unless options[:foreground]

        system command
      end

      desc 'stop', 'Stop background services'
      def stop
        system "#{base_command} down"
      end

      desc 'build', 'Build background service images'
      def build
        system "#{base_command} build"
      end

      desc 'pull', 'Pull background service images'
      def pull
        system "#{base_command} pull"
      end

      desc 'logs', 'Display the logs for the background services'
      option :follow,
             default: false,
             aliases: [:f],
             type: :boolean,
             desc: 'Follow log output'
      option :tail,
             banner: 'string',
             default: 'all',
             desc: 'Number of lines to show from the end of the logs for each container'
      def logs
        command = "#{base_command} logs"
        command += ' -f' if options[:follow]
        command += " --tail #{options[:tail]}" if options[:tail]

        system command
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
inferno_core-0.4.22 lib/inferno/apps/cli/services.rb
inferno_core-0.4.21 lib/inferno/apps/cli/services.rb
inferno_core-0.4.20 lib/inferno/apps/cli/services.rb
inferno_core-0.4.19 lib/inferno/apps/cli/services.rb
inferno_core-0.4.18 lib/inferno/apps/cli/services.rb
inferno_core-0.4.17 lib/inferno/apps/cli/services.rb
inferno_core-0.4.16 lib/inferno/apps/cli/services.rb
inferno_core-0.4.15 lib/inferno/apps/cli/services.rb
inferno_core-0.4.14 lib/inferno/apps/cli/services.rb
inferno_core-0.4.13 lib/inferno/apps/cli/services.rb
inferno_core-0.4.12 lib/inferno/apps/cli/services.rb
inferno_core-0.4.11 lib/inferno/apps/cli/services.rb
inferno_core-0.4.10 lib/inferno/apps/cli/services.rb
inferno_core-0.4.9 lib/inferno/apps/cli/services.rb
inferno_core-0.4.8 lib/inferno/apps/cli/services.rb
inferno_core-0.4.7 lib/inferno/apps/cli/services.rb
inferno_core-0.4.7.pre lib/inferno/apps/cli/services.rb
inferno_core-0.4.6 lib/inferno/apps/cli/services.rb
inferno_core-0.4.5 lib/inferno/apps/cli/services.rb
inferno_core-0.4.4 lib/inferno/apps/cli/services.rb