lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.6 vs lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.7
- old
+ new
@@ -65,20 +65,21 @@
else
@logger.error "The PROJECT_NAMES file (#{ENV['PROJECT_NAMES']}) does not exist!"
@vars[:return_code] = Errors::NO_PROJECT_NAMES
end
end
+ exts = {}
exts = Hash[@vars[:artifacts].map { |a| [a[:data][:name], File.basename(a[:data][:file]).match(CiCd::Builder::Manifest::Build::EXT_RGX)[1]] }]
- @manifest.each do |mod, man|
- man.each do |prod, build|
- projects[prod] = {
- name: project_names[prod] || prod,
- module: mod,
- ext: exts[prod],
- class_filter: '',
- }
- end
+ @vars[:artifacts].each do |art|
+ prod = art[:data][:name]
+ mod = art[:data][:module]
+ projects[prod] = {
+ name: project_names[prod] || prod,
+ module: mod,
+ ext: exts[prod],
+ class_filter: '',
+ }
end
@logger.info "Save PROJECTS_FILE: #{ENV['PROJECTS_FILE']}"
IO.write(ENV['PROJECTS_FILE'], JSON.pretty_generate(projects, {indent: "\t", space: ' '}))
end
@@ -105,11 +106,11 @@
data[:name] = amn
@vars[:artifacts] << {
key: amn,
data: data.dup,
}
- manifest[amn]={ amn => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
+ # manifest[amn]={ amn => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
maybeUploadArtifactoryObject(data: data, artifact_module: amn, artifact_version: data[:version] || @vars[:version], file_name: '', file_ext: 'properties')
end
# ---------------------------------------------------------------------------------------------------------------
@@ -135,10 +136,10 @@
@vars[:artifacts] << {
key: "#{mod}-manifest",
data: data.dup,
}
# noinspection RubyStringKeysInHashInspection
- manifest["#{mod}-manifest"]={ "#{mod}-manifest" => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
+ # manifest["#{mod}-manifest"]={ "#{mod}-manifest" => "#{@vars[:build_ver]}-#{@vars[:build_num]}" }
maybeUploadArtifactoryObject(data: data, artifact_module: data[:name], artifact_version: data[:version] || @vars[:version], file_name: '', file_ext: 'properties') # -#{@vars[:variant]}
end
end