Skip to content

Commit

Permalink
Fixed marklogic-community#650: make sure server-version gets defaulte…
Browse files Browse the repository at this point in the history
…d properly in all cases
  • Loading branch information
grtjn committed May 31, 2017
1 parent 2900ffc commit 31c64c2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,19 @@ def self.initcpf
def self.prompt_server_version
if @@no_prompt
puts 'Required option --server-version=[version] not specified with valid value,
but --no-prompt parameter prevents prompting for password. Assuming 8.'
but --no-prompt parameter prevents prompting for password.'
server_version = 0
else
puts 'Required option --server-version=[version] not specified with valid value.
What is the version number of the target MarkLogic server? [5, 6, 7, 8, or 9]'
server_version = STDIN.gets.chomp.to_i
server_version = 8 if server_version == 0
server_version
end
if server_version == 0
puts "Defaulting to 8.."
server_version = 8
end
server_version
end

def self.index
Expand Down Expand Up @@ -1191,10 +1195,10 @@ def install
if File.exist?(@properties["ml.schemas.dir"])
deploy_schemas
end
if @properties["ml.triggers-db"] then
if @properties["ml.triggers-db"]
deploy_triggers
end
if @properties["ml.triggers-db"] and @properties["ml.data.dir"] and File.exist?(ServerConfig.expand_path("#{@@path}/pipeline-config.xml")) then
if @properties["ml.triggers-db"] and @properties["ml.data.dir"] and File.exist?(ServerConfig.expand_path("#{@@path}/pipeline-config.xml"))
deploy_cpf
end
deploy_content
Expand Down Expand Up @@ -2897,7 +2901,7 @@ def ServerConfig.properties(prop_file_location = @@path)
properties.merge!(ServerConfig.load_properties(properties_file, "ml."))

#Look for optional shared_config, if it is set grab the properties from path relative to the root of the roxy project
if properties['ml.shared_config'] then
if properties['ml.shared_config']
shared_properties_file = ServerConfig.expand_path("#{@@path}/../#{properties['ml.shared_config']}")
properties.merge!(ServerConfig.load_properties(shared_properties_file))
end
Expand Down

0 comments on commit 31c64c2

Please sign in to comment.