Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #769 from grtjn/650-prompt-server-version
Browse files Browse the repository at this point in the history
Fixed #650: make sure server-version gets defaulted properly in all cases
  • Loading branch information
RobertSzkutak committed Jun 13, 2017
2 parents 0c8ea68 + e6f72cc commit c290907
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ def initialize(options)

@server_version = @properties["ml.server-version"].to_i

if (@server_version < 7)
logger.warn "WARN: This version of Roxy is not tested against MarkLogic #{@server_version}."
if (@server_version > 4)
logger.info " Consider downgrading to v1.7.0 using `./ml upgrade --branch=v1.7.0`."
end
logger.warn "Note: MarkLogic #{@server_version} is EOL."
end

if @properties["ml.bootstrap-port"]
@bootstrap_port = @properties["ml.bootstrap-port"]
else
Expand Down Expand Up @@ -323,15 +331,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]'
What is the version number of the target MarkLogic server? [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 9.."
server_version = 9
end
server_version
end

def self.index
Expand Down Expand Up @@ -1261,10 +1273,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(@properties["ml.pipeline-config-file"])) then
if @properties["ml.triggers-db"] and @properties["ml.data.dir"] and File.exist?(ServerConfig.expand_path(@properties["ml.pipeline-config-file"]))
deploy_cpf
end
deploy_content
Expand Down Expand Up @@ -3046,7 +3058,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 c290907

Please sign in to comment.