-
Notifications
You must be signed in to change notification settings - Fork 66
Configurable /app/config/config.xqy file #665
Comments
We could perhaps think of something slightly more generic too. |
I don't think we want to get into wildcards. The idea was that there should be a place to communicate properties from Roxy to code. I like the idea of using a property to specify what that file should be (and allowing SJS), but we don't want to be doing property replacements throughout the code. |
I'm not suggesting enabling this by default. The default would be just doing what happens now. But I see not much harm in allowing wider scale application. It could be convenient to be able to do something like |
I'm with Dave in this one. |
The potential harm of allowing widespread property substitution:
Keeping it to a particular file or two (configurable) is the principle of encapsulation, which I think makes sense. |
Fair enough.. comma-separated, no wildcards then. Who wants to do a PR? :) |
Is it ok if I implement it like the following pattern: application-conf-file=<template1>,<target1>,<template2>,<target2>...<templateN>,<targetN> example: application-conf-file=src/ui/util/rest.service.tmpl.js,src/ui/util/rest.service.js,src/rest-api/config.tmpl.xqy,src/rest-api/config.xqy or application-conf-file=<template1>'=>'<target1>,<template2>'=>'<target2>...<templateN>'>'<targetN> example: application-conf-file=src/ui/util/rest.service.tmpl.js=>src/ui/util/rest.service.js,src/rest-api/config.tmpl.xqy=>src/rest-api/config.xqy This will avoid overwriting the template or putting everything into a temporary folder before deploying. |
@divino I'm not sure what you mean by templates. This feature is described in the Deployer Substitution wiki, allowing the developer to have code such as:
The deployer will replace |
Upon review of the code, it looks like this is already implemented but the current implementation forces user to use "/app/config/config.xqy" as configuration file. See code below. app_config_file = File.join xquery_dir, "/app/config/config.xqy" ... if File.exist? app_config_file
buffer = File.read app_config_file
replace_properties(buffer, File.basename(app_config_file))
total_count += xcc.load_buffer "/config.xqy",
buffer,
:db => dest_db,
:add_prefix => File.join(@properties["ml.modules-root"], "app/config"),
:permissions => src_permissions
end |
Do we support both the current and the proposed? |
The current feature handles replacement of properties in a single, hard-coded file. The intent of this issue is to enhance the capability:
With all that in mind, a project that currently uses the feature should be able to update the Roxy Deployer code and still work without change. |
fixed in dev |
Currently it's not possible to include roxy environment variables into SJS configuration modules.
I will be nice to be able to configure which file we intend to use as a central configuration file.
For example:
application-conf-file=/app/config/config.sjs
Or even better:
application-conf-file=('/app/config/service1-related-config.xqy', '/app/config/service2-related-config.xqy')
The text was updated successfully, but these errors were encountered: