#840: new deploy_info parameter 'json_file'
This commit is contained in:
parent
84822598a2
commit
74a9530888
@ -353,14 +353,20 @@ module Devops
|
||||
cmd = "chef-client --no-color"
|
||||
if deploy_info["use_json_file"]
|
||||
deploy_info.delete("use_json_file")
|
||||
@out << "Deploy Input Parameters:\n"
|
||||
json = JSON.pretty_generate(deploy_info)
|
||||
@out.puts json
|
||||
file = "#{@server.project}_#{@server.deploy_env}_#{Time.new.to_i}"
|
||||
json = nil
|
||||
dir = DevopsConfig.config[:project_info_dir]
|
||||
File.open(File.join(dir, file), "w") do |f|
|
||||
f.write json
|
||||
file = deploy_info["json_file"] || "#{@server.project}_#{@server.deploy_env}_#{Time.new.to_i}"
|
||||
path = File.join(dir, file)
|
||||
if File.exists?(path)
|
||||
json = File.read(path)
|
||||
else
|
||||
json = JSON.pretty_generate(deploy_info)
|
||||
File.open(File.join(dir, file), "w") do |f|
|
||||
f.write json
|
||||
end
|
||||
end
|
||||
@out << "Deploy Input Parameters:\n"
|
||||
@out.puts json
|
||||
@out.flush
|
||||
cmd << " -j http://#{DevopsConfig.config[:address]}:#{DevopsConfig.config[:port]}/#{DevopsConfig.config[:url_prefix]}/v2.0/deploy/data/#{file}"
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user