Sha256: bd63d4239c5d4f087d449da8d98ba669abfa97cd674768173c73a7f0de83da99
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 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 @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.2 | lib/vx/builder/deploy_builder.rb |