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

Commit 62412bd

Browse files
committed
implemented based on review points
1 parent 6051878 commit 62412bd

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

deploy/lib/server_config.rb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,26 @@ def self.init
186186
sample_properties = "roxy/sample/build.sample.properties"
187187
sample_options = "roxy/sample/all.sample.xml"
188188
sample_rest_properties = "roxy/sample/properties.sample.xml"
189+
sample_app_config = "roxy/deploy/sample/custom-config.xqy"
189190
else
190-
sample_config = ServerConfig.expand_path("#{@@path}/sample/ml-config.sample.xml")
191-
sample_properties = ServerConfig.expand_path("#{@@path}/sample/build.sample.properties")
191+
sample_config = ServerConfig.expand_path("#{@@path}/sample/ml-config.sample.xml")
192+
sample_properties = ServerConfig.expand_path("#{@@path}/sample/build.sample.properties")
192193
sample_options = ServerConfig.expand_path("#{@@path}/sample/all.sample.xml")
193194
sample_rest_properties = ServerConfig.expand_path("#{@@path}/sample/properties.sample.xml")
195+
sample_app_config = ServerConfig.expand_path("#{@@path}/sample/custom-config.xqy")
194196
end
195197

196198
# output files
197199
build_properties = ServerConfig.expand_path("#{@@path}/build.properties")
198200
options_file = ServerConfig.expand_path("#{@@path}/../rest-api/config/options/all.xml")
199201
rest_properties = ServerConfig.expand_path("#{@@path}/../rest-api/config/properties.xml")
202+
app_config = ServerConfig.expand_path("#{@@path}/../src/config/config.xqy")
200203

201204
# dirs to create
202205
rest_ext_dir = ServerConfig.expand_path("#{@@path}/../rest-api/ext")
203206
rest_transforms_dir = ServerConfig.expand_path("#{@@path}/../rest-api/transforms")
204207
options_dir = ServerConfig.expand_path("#{@@path}/../rest-api/config/options")
208+
config_dir = ServerConfig.expand_path("#{@@path}/../src/config")
205209

206210
# get supplied options
207211
force = find_arg(['--force']).present?
@@ -248,10 +252,6 @@ def self.init
248252
properties_file.gsub!(/error-handler=\/roxy\/error.xqy/, "error-handler=/MarkLogic/rest-api/error-handler.xqy")
249253
end
250254

251-
if app_type == "mvc"
252-
properties_file.gsub!(/application-conf-file=deploy\/sample\/custom-config.xqy/, 'application-conf-file=src/app/config/config.xqy,deploy/sample/custom-config.xqy')
253-
end
254-
255255
# replace the text =random with a random string
256256
o = (33..126).to_a
257257
properties_file.gsub!(/=random/) do |match|
@@ -262,6 +262,10 @@ def self.init
262262
# Update properties file to set server-version to value specified on command-line
263263
properties_file.gsub!(/server-version=6/, "server-version=#{server_version}")
264264

265+
if ["rest", "bare"].include? app_type
266+
properties_file.gsub!(/application-conf-file=src\/app\/config\/config.xqy/, 'application-conf-file=src/config/config.xqy')
267+
end
268+
265269
# save the replacements
266270
open(build_properties, 'w') {|f| f.write(properties_file) }
267271
end
@@ -275,6 +279,11 @@ def self.init
275279
copy_file sample_rest_properties, rest_properties
276280
end
277281

282+
if ["rest", "bare"].include? app_type
283+
FileUtils.mkdir_p config_dir
284+
copy_file sample_app_config, app_config
285+
end
286+
278287
target_config = ServerConfig.expand_path(ServerConfig.properties["ml.config.file"])
279288

280289
if !force && !force_config && File.exists?(target_config)

deploy/sample/build.sample.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,4 @@ save-commit-info=false
215215
# Assign a comma separated custom configuration files relative to root folder.
216216
#
217217
# Contents of the files will be replaced with data from the properties files.
218-
application-conf-file=deploy/sample/custom-config.xqy
218+
application-conf-file=src/app/config/config.xqy

0 commit comments

Comments
 (0)