Sha256: 56670b1452233b1a7a6fc8b777f43c487829a91f2856e0a48c9c22e8a9ff5bde
Contents?: true
Size: 938 Bytes
Versions: 22
Compression:
Stored size: 938 Bytes
Contents
module Buildkite module Builder module Extensions class Plugins < Extension attr_reader :manager dsl do def plugin(name, uri, default_attributes = {}) context.extensions.find(Buildkite::Builder::Extensions::Plugins).manager.add(name, uri, default_attributes) end end def prepare @manager = PluginManager.new end def build context.data.steps.each(:command) do |step| next unless step.has?(:plugins) step.get(:plugins).map! do |plugin| resource, attributes = extract_resource_and_attributes(plugin) resource.is_a?(Symbol) ? manager.build(resource, attributes) : plugin end end end private def extract_resource_and_attributes(plugin) [plugin.keys.first, plugin.values.first] end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems