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 #785 from grtjn/500-task-host
Browse files Browse the repository at this point in the history
Fixed #500: linking sample tasks to bootstrap host by default
  • Loading branch information
RobertSzkutak committed Jun 13, 2017
2 parents c290907 + 3f0a7c4 commit c54a421
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 21 deletions.
7 changes: 7 additions & 0 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def initialize(options)
else
@qconsole_port = @bootstrap_port
end

begin
r = execute_query %Q{xdmp:host-name()}
@properties["ml.server-name"] = parse_body(r.body)
rescue
logger.warn "WARN: unable to determine MarkLogic Host name of #{@hostname}"
end
end

def get_properties
Expand Down
23 changes: 14 additions & 9 deletions deploy/sample/ml-config.sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
<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}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/hourly-task.xqy</task-path>
Expand All @@ -41,7 +42,8 @@
<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}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/minutely-task.xqy</task-path>
Expand All @@ -50,7 +52,8 @@
<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}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/monthly-task.xqy</task-path>
Expand All @@ -61,17 +64,18 @@
<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}"/>
<task-host name="${server-name}"/>
</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}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/weekly-task.xqy</task-path>
Expand All @@ -86,7 +90,8 @@
<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}"/>
<task-host name="${server-name}"/>
</scheduled-task>
</scheduled-tasks>
</task-server>
Expand Down Expand Up @@ -530,8 +535,8 @@
</roles>
<users xmlns="http://marklogic.com/xdmp/security">
<user>
<user-name>${app-name}-user</user-name>
<description>A user for the ${app-name} application</description>
<user-name>${default-user}</user-name>
<description>The default user for the ${app-name} application</description>
<password>${appuser-password}</password>
<role-names>
<role-name>${app-role}</role-name>
Expand Down
18 changes: 12 additions & 6 deletions deploy/test/data/ml7-config-changed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/hourly-task.xqy</task-path>
Expand All @@ -30,7 +31,8 @@
<task-minute>15</task-minute>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/minutely-task.xqy</task-path>
Expand All @@ -39,7 +41,8 @@
<task-period>3</task-period>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/monthly-task.xqy</task-path>
Expand All @@ -50,7 +53,8 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/once-task.xqy</task-path>
Expand All @@ -59,7 +63,8 @@
<task-start>2019-01-01T13:00:00-05:00</task-start>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/weekly-task.xqy</task-path>
Expand All @@ -74,7 +79,8 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
</scheduled-tasks>
</task-server>
Expand Down
18 changes: 12 additions & 6 deletions deploy/test/data/ml7-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/hourly-task.xqy</task-path>
Expand All @@ -30,7 +31,8 @@
<task-minute>15</task-minute>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/minutely-task.xqy</task-path>
Expand All @@ -39,7 +41,8 @@
<task-period>3</task-period>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/monthly-task.xqy</task-path>
Expand All @@ -50,7 +53,8 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/once-task.xqy</task-path>
Expand All @@ -59,7 +63,8 @@
<task-start>2019-01-01T13:00:00-05:00</task-start>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
<scheduled-task>
<task-path>/some/weekly-task.xqy</task-path>
Expand All @@ -74,7 +79,8 @@
<task-start-time>13:00:00-05:00</task-start-time>
<task-database name="@ml.content-db"/>
<task-modules name="@ml.modules-db"/>
<task-user name="@ml.app-name-user"/>
<task-user name="${default-user}"/>
<task-host name="${server-name}"/>
</scheduled-task>
</scheduled-tasks>
</task-server>
Expand Down

0 comments on commit c54a421

Please sign in to comment.