Skip to content

Commit

Permalink
XDOCKER-51: Expose configuration options to configure an XWiki cluster
Browse files Browse the repository at this point in the history
* Edited the sed command to replace Examples
  • Loading branch information
ASHISH932 committed Aug 24, 2019
1 parent c0c76b1 commit ec2321c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ nbproject
.sonar-ide.properties
.clover
*~
.DS_Store
9 changes: 7 additions & 2 deletions template/xwiki/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit ec2321c

Please sign in to comment.