lib/cicd/builder/chefrepo-manifest/mixlib/build.rb in chefrepo-manifest-builder-0.2.2 vs lib/cicd/builder/chefrepo-manifest/mixlib/build.rb in chefrepo-manifest-builder-0.2.3
- old
+ new
@@ -23,10 +23,11 @@
key,json,over = @repo.pullInventory(product)
if json.nil?
@logger.error "Bad repo/inventory specified. s3://#{ENV['AWS_S3_BUCKET']}/#{key}"
@vars[:return_code] = Errors::PRUNE_BAD_REPO
else
+ versrels = nil
if json['container'] and json['container']['variants']
# but does not have our variant ...
variants = json['container']['variants']
@logger.info "\tVariants: #{variants.keys.size} \n#{variants.keys.ai}"
variants.each do |variant,varianth|
@@ -69,23 +70,23 @@
drawer = nil
end
end
unless drawer
if branches.include?(@vars[:branch])
- survivors = builds.select{ |drawer|
- bra = @repo._getBranch(@vars, drawer)
+ survivors = builds.select{ |dwr|
+ bra = @repo._getBranch(@vars, dwr)
bra == @vars[:branch]
}
builds = survivors
if versions.include?(@vars[:version])
- survivors = builds.select{ |drawer|
- ver = @repo._getVersion(@vars, drawer)
+ survivors = builds.select{ |draw|
+ ver = @repo._getVersion(@vars, draw)
ver == @vars[:version]
}
builds = survivors
- if versrels.include?("#{@vars[:version]}-#{@vars[:release]}")
- survivors = builds.select{ |drawer|
- rel = @repo._getRelease(@vars, drawer)
+ if versrels and versrels.include?("#{@vars[:version]}-#{@vars[:release]}")
+ survivors = builds.select{ |draw|
+ rel = @repo._getRelease(@vars, draw)
rel == @vars[:release]
}
builds = survivors
drawer = builds[-1]
else