Sha256: 95d85e2ef1e4441423eaefe632283c367bae1968ca0577189e1c750e50a11e4f
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
module Vx module Builder class DeployBuilder BLACK_LIST = %w{ image before_script after_success script deploy_modules } attr_reader :base_build_configuration, :matrix_build_configuration, :branch def initialize(matrix_builder, options = {}) @base_build_configuration = matrix_builder.build_configuration @matrix_build_configuration = matrix_builder.build.first || matrix_builder.build_configuration @branch = options[:branch] end def build @build ||= begin return [] unless valid? hash = matrix_build_configuration.to_hash BLACK_LIST.each do |key| hash.delete key end hash["env"]["matrix"] = [] build_configuration = BuildConfiguration.new( hash.merge( "deploy_modules" => deploy_modules.map(&:to_hash), "deploy" => nil ) ) [build_configuration] end end def valid? deploy? and deploy_modules.any? end def deploy_modules @deploy_modules ||= deploy.find_modules(branch) end def deploy base_build_configuration.deploy end def deploy? deploy.attributes.any? end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vx-builder-0.3.3 | lib/vx/builder/deploy_builder.rb |