From ec2321c5a665ebc7a6b39ea89e696e3f75dcf7ac Mon Sep 17 00:00:00 2001 From: ashish Date: Sat, 24 Aug 2019 16:49:57 +0530 Subject: [PATCH] XDOCKER-51: Expose configuration options to configure an XWiki cluster * Edited the sed command to replace Examples --- .gitignore | 1 + template/xwiki/docker-entrypoint.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ccdff0b8..c422e771 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ nbproject .sonar-ide.properties .clover *~ +.DS_Store diff --git a/template/xwiki/docker-entrypoint.sh b/template/xwiki/docker-entrypoint.sh index 70a508ee..cee19449 100755 --- a/template/xwiki/docker-entrypoint.sh +++ b/template/xwiki/docker-entrypoint.sh @@ -39,6 +39,11 @@ function other_starts() { function xwiki_replace() { sed -i s~"\\#\\? \\?\$2 \\?=.*"~"\$2=\$3"~g "\$1" } +# \$1 - the setting/property to set +# \$2 - the new value +function xwiki_replace_example() { + sed -i s~"\#-# Example:\? \?$1 \?=.*"~"$1=$2"~g "/usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.properties" +} # \$1 - the setting/property to set # \$2 - the new value @@ -109,9 +114,9 @@ function enableClustering() { xwiki_set_properties 'observation.remote.enabled' 'true' if [ \$CLUSTER_CHANNEL ]; then echo "Setting cluster channel to \$CLUSTER_CHANNEL" - xwiki_set_properties 'observation.remote.channels' "\$CLUSTER_CHANNEL" + xwiki_replace_example 'observation.remote.channels' "\$CLUSTER_CHANNEL" else - xwiki_set_properties 'observation.remote.channels' 'udp' + xwiki_replace_example 'observation.remote.channels' 'udp' fi }