lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.5.15 vs lib/cicd/builder/manifest/mixlib/repo/artifactory.rb in manifest-builder-0.6.0
- old
+ new
@@ -78,14 +78,16 @@
ext: exts[prod],
class_filter: '',
}
end
+ require 'chef/mash'
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)
+ old_projects = Chef::Mash.new(File.exists?(ENV['PROJECTS_FILE']) ? JSON.load(IO.read(ENV['PROJECTS_FILE'])) : {})
+ projects = Chef::Mash.new(projects)
+ projects = Chef::Mash.new(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: ' '}))
+ IO.write(ENV['PROJECTS_FILE'], JSON.pretty_generate(projects.to_hash, {indent: "\t", space: ' '}))
data = {
name: 'projects-file',
module: 'projects-file',
file: ENV['PROJECTS_FILE'],
version: @vars[:build_ver],