lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.13 vs lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.14

- old
+ new

@@ -77,11 +77,28 @@ module: mod, ext: exts[prod], class_filter: '', } end + + require 'chef/mixin/deep_merge' + old_projects = File.exists?(ENV['PROJECTS_FILE']) ? JSON.load(IO.read(ENV['PROJECTS_FILE'])) : {} + projects = Chef::Mixin::DeepMerge.deep_merge(projects, old_projects) @logger.info "Save PROJECTS_FILE: #{ENV['PROJECTS_FILE']}" IO.write(ENV['PROJECTS_FILE'], JSON.pretty_generate(projects, {indent: "\t", space: ' '})) + data = { + name: 'projects-file', + module: 'projects-file', + file: ENV['PROJECTS_FILE'], + version: @vars[:build_ver], + build: @vars[:build_num], + properties: @properties_matrix, + temp: false, + sha1: Digest::SHA1.file(ENV['PROJECTS_FILE']).hexdigest, + md5: Digest::MD5.file(ENV['PROJECTS_FILE']).hexdigest, + } + + maybeUploadArtifactoryObject(data: data, artifact_module: data[:name], artifact_version: data[:version] || @vars[:version], file_name: '', file_ext: 'json') end def createSuperManifest(manifest) manifest_data = '' manifest.each do |mod, man|