Skip to content

Commit

Permalink
marklogic-community#808: a few small changes to make it actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
grtjn committed Jun 14, 2017
1 parent 9d1f4a2 commit ff509ae
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
32 changes: 16 additions & 16 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,7 @@ def conditional_prop(prop, default_prop)

def triggers_db_xml
%Q{
<database>
<database xmlns="http://marklogic.com/xdmp/database">
<database-name>@ml.triggers-db</database-name>
<forests>
<forest-id name="@ml.triggers-db"/>
Expand All @@ -2696,7 +2696,7 @@ def triggers_db_xml

def triggers_assignment
%Q{
<assignment>
<assignment xmlns="http://marklogic.com/xdmp/assignments">
<forest-name>@ml.triggers-db</forest-name>
</assignment>
}
Expand All @@ -2705,7 +2705,7 @@ def triggers_assignment
def xdbc_server
xdbc_auth_method = conditional_prop('ml.xdbc-authentication-method', 'ml.authentication-method')
%Q{
<xdbc-server>
<xdbc-server xmlns="http://marklogic.com/xdmp/group">
<xdbc-server-name>@ml.app-name-xcc</xdbc-server-name>
<port>@ml.xcc-port</port>
<database name="@ml.content-db"/>
Expand All @@ -2718,7 +2718,7 @@ def xdbc_server
def odbc_server
odbc_auth_method = conditional_prop('ml.odbc-authentication-method', 'ml.authentication-method')
%Q{
<odbc-server>
<odbc-server xmlns="http://marklogic.com/xdmp/group">
<odbc-server-name>@ml.app-name-odbc</odbc-server-name>
<port>@ml.odbc-port</port>
<database name="@ml.content-db"/>
Expand All @@ -2730,7 +2730,7 @@ def odbc_server

def schemas_db_xml
%Q{
<database>
<database xmlns="http://marklogic.com/xdmp/database">
<database-name>@ml.schemas-db</database-name>
<forests>
<forest-id name="@ml.schemas-db"/>
Expand All @@ -2741,15 +2741,15 @@ def schemas_db_xml

def schemas_assignment
%Q{
<assignment>
<assignment xmlns="http://marklogic.com/xdmp/assignments">
<forest-name>@ml.schemas-db</forest-name>
</assignment>
}
end

def test_content_db_xml
%Q{
<database import="@ml.content-db">
<database import="@ml.content-db" xmlns="http://marklogic.com/xdmp/database">
<database-name>@ml.test-content-db</database-name>
<forests>
<forest-id name="@ml.test-content-db"/>
Expand All @@ -2760,7 +2760,7 @@ def test_content_db_xml

def test_content_db_assignment
%Q{
<assignment>
<assignment xmlns="http://marklogic.com/xdmp/assignments">
<forest-name>@ml.test-content-db</forest-name>
</assignment>
}
Expand All @@ -2773,7 +2773,7 @@ def test_appserver
test_default_user = conditional_prop('ml.test-default-user', 'ml.default-user')

%Q{
<http-server import="@ml.app-name">
<http-server import="@ml.app-name" xmlns="http://marklogic.com/xdmp/group">
<http-server-name>@ml.app-name-test</http-server-name>
<port>@ml.test-port</port>
<database name="@ml.test-content-db"/>
Expand All @@ -2786,7 +2786,7 @@ def test_appserver

def test_modules_db_xml
%Q{
<database import="@ml.modules-db">
<database import="@ml.modules-db" xmlns="http://marklogic.com/xdmp/database">
<database-name>@ml.test-modules-db</database-name>
<forests>
<forest-id name="@ml.test-modules-db"/>
Expand All @@ -2797,7 +2797,7 @@ def test_modules_db_xml

def test_user_xml
%Q{
<user>
<user xmlns="http://marklogic.com/xdmp/security">
<user-name>${test-user}</user-name>
<description>A user for the ${app-name} unit tests</description>
<password>${test-user-password}</password>
Expand All @@ -2812,7 +2812,7 @@ def test_user_xml

def test_modules_db_assignment
%Q{
<assignment>
<assignment xmlns="http://marklogic.com/xdmp/assignments">
<forest-name>@ml.test-modules-db</forest-name>
</assignment>
}
Expand All @@ -2833,7 +2833,7 @@ def rest_appserver
end

%Q{
<http-server import="@ml.app-name">
<http-server import="@ml.app-name" xmlns="http://marklogic.com/xdmp/group">
<http-server-name>@ml.app-name-rest</http-server-name>
<port>@ml.rest-port</port>
<database name="@ml.content-db"/>
Expand All @@ -2851,7 +2851,7 @@ def rest_modules_db_xml
rest_modules_db = conditional_prop('ml.rest-modules-db', 'ml.modules-db')

%Q{
<database>
<database xmlns="http://marklogic.com/xdmp/database">
<database-name>#{rest_modules_db}</database-name>
<forests>
<forest-id name="#{rest_modules_db}"/>
Expand All @@ -2864,15 +2864,15 @@ def rest_modules_db_assignment
rest_modules_db = conditional_prop('ml.rest-modules-db', 'ml.modules-db')

%Q{
<assignment>
<assignment xmlns="http://marklogic.com/xdmp/assignments">
<forest-name>#{rest_modules_db}</forest-name>
</assignment>
}
end

def ssl_certificate_xml
%Q{
<certificate>
<certificate xmlns="http://marklogic.com/xdmp/pki">
<name>@ml.ssl-certificate-template</name>
<countryName>@ml.ssl-certificate-countryName</countryName>
<stateOrProvinceName>@ml.ssl-certificate-stateOrProvinceName</stateOrProvinceName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<local-name>sample</local-name>
<doc-uri>/app/models/sample.xqy</doc-uri>
<db-name>${modules-db}</db-name>
<role-name>a-privileged-role</role-name>
<role-name>${app-role}</role-name>
</amp>
13 changes: 6 additions & 7 deletions deploy/sample/ml-config.sample/tasks/tasks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="${content-db}"/>
<task-modules name="${modules-db}"/>
<task-user name="${app-name}-user"/>
<task-user name="${default-user}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/hourly-task.xqy</task-path>
Expand All @@ -38,7 +38,7 @@
<task-minute>15</task-minute>
<task-database name="${content-db}"/>
<task-modules name="${modules-db}"/>
<task-user name="${app-name}-user"/>
<task-user name="${default-user}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/minutely-task.xqy</task-path>
Expand All @@ -47,7 +47,7 @@
<task-period>3</task-period>
<task-database name="${content-db}"/>
<task-modules name="${modules-db}"/>
<task-user name="${app-name}-user"/>
<task-user name="${default-user}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/monthly-task.xqy</task-path>
Expand All @@ -58,17 +58,16 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="${content-db}"/>
<task-modules name="${modules-db}"/>
<task-user name="${app-name}-user"/>
<task-user name="${default-user}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/once-task.xqy</task-path>
<task-root>/</task-root>
<task-type>once</task-type>
<task-period>1</task-period>
<task-start>2019-01-01T13:00:00-05:00</task-start>
<task-database name="${content-db}"/>
<task-modules name="${modules-db}"/>
<task-user name="${app-name}-user"/>
<task-user name="${default-user}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/weekly-task.xqy</task-path>
Expand All @@ -83,7 +82,7 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="${content-db}"/>
<task-modules name="${modules-db}"/>
<task-user name="${app-name}-user"/>
<task-user name="${default-user}"/>
</scheduled-task>
</scheduled-tasks>
</task-server>
Expand Down

0 comments on commit ff509ae

Please sign in to comment.