Sha256: af4aede43aada9d9dcde2908aeb0d99e391b4f687ad25e88d7e9e61d6ee2d508

Contents?: true

Size: 838 Bytes

Versions: 6

Compression:

Stored size: 838 Bytes

Contents

# frozen_string_literal: true

module Floe
  class Workflow
    class Runner
      include Logging

      TYPES = %w[docker podman kubernetes].freeze

      def initialize(_options = {})
      end

      class << self
        attr_writer :docker_runner

        def docker_runner
          @docker_runner ||= Floe::Workflow::Runner::Docker.new
        end

        def for_resource(resource)
          raise ArgumentError, "resource cannot be nil" if resource.nil?

          scheme = resource.split("://").first
          case scheme
          when "docker"
            docker_runner
          else
            raise "Invalid resource scheme [#{scheme}]"
          end
        end
      end

      def run!(image, env = {}, secrets = {})
        raise NotImplementedError, "Must be implemented in a subclass"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
floe-0.3.1 lib/floe/workflow/runner.rb
floe-0.3.0 lib/floe/workflow/runner.rb
floe-0.2.3 lib/floe/workflow/runner.rb
floe-0.2.2 lib/floe/workflow/runner.rb
floe-0.2.1 lib/floe/workflow/runner.rb
floe-0.2.0 lib/floe/workflow/runner.rb