Commit c468d949 by ifool

Update setup_script.rb and setup.rb

parent 2b7e2411
...@@ -4,7 +4,7 @@ require 'json' ...@@ -4,7 +4,7 @@ require 'json'
def download_server_json def download_server_json
product_name = ARGV[0] product_name = ARGV[0]
config_root = File.expand_path('..', __FILE__) config_root = File.expand_path('..', __FILE__)
git_branch = `git rev-parse --abbrev-ref HEAD`.chop git_branch = `cd #{config_root}; git rev-parse --abbrev-ref HEAD`.chop
dir_basename = File.basename config_root dir_basename = File.basename config_root
server_conf_url = "http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master/#{product_name}/#{git_branch}_#{dir_basename}/server.json" server_conf_url = "http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master/#{product_name}/#{git_branch}_#{dir_basename}/server.json"
puts "Use server config url: #{server_conf_url}" puts "Use server config url: #{server_conf_url}"
......
...@@ -2,14 +2,16 @@ ...@@ -2,14 +2,16 @@
product_name = ARGV[0] # crm, jxc, bms product_name = ARGV[0] # crm, jxc, bms
dir_name = ARGV[1] # dev, test, staging, prod dir_name = ARGV[1] # dev, test, staging, prod
config_root = File.expand_path("../#{dir_name}", __FILE__)
if dir_name.nil? if dir_name.nil?
raise "Dir name is required!" raise "Dir name is required!"
elsif !Dir.exists?(dir_name) elsif !Dir.exists?(config_root)
raise "Dir: #{dir_name} not exists!" raise "Dir: #{config_root} not exists!"
end end
puts "======================= config_root is: #{config_root} ======================="
git_config_url = "http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master" git_config_url = "http://gitlab.ikcrm.com/ikcrm_common/servers_config/raw/master"
config_root = File.expand_path("../#{dir_name}", __FILE__)
setup_url = "#{git_config_url}/setup.rb" setup_url = "#{git_config_url}/setup.rb"
puts "Use setup url: #{setup_url}" puts "Use setup url: #{setup_url}"
system "curl #{setup_url} > #{config_root}/setup.rb" system "curl #{setup_url} > #{config_root}/setup.rb"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment