Sha256: 33174faab1da3a223168b1ff8460367890b4e9b262e08e7dca8038c9ac727764

Contents?: true

Size: 604 Bytes

Versions: 12

Compression:

Stored size: 604 Bytes

Contents

# frozen_string_literal: true

module Buildkite
  module Pipelines
    module Helpers
      module Plugins
        def plugin(plugin_name, options = nil)
          plugin_name = plugin_name.to_s
          @plugins ||= {}

          if @plugins.key?(plugin_name)
            raise ArgumentError, "Plugin already used for command step: #{plugin_name}"
          end

          uri, version = pipeline.plugins.fetch(plugin_name)
          new_plugin = Plugin.new(uri, version, options)
          @plugins[plugin_name] = new_plugin

          plugins(new_plugin.to_h)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
buildkite-builder-1.4.1 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.4.0 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.3.1 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.3.0 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.2.0 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.1.0 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.0.0 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.0.0.beta.5 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.0.0.beta.4 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.0.0.beta.3 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.0.0.beta.2 lib/buildkite/pipelines/helpers/plugins.rb
buildkite-builder-1.0.0.beta.1 lib/buildkite/pipelines/helpers/plugins.rb