Skip to content

Commit

Permalink
XDOCKER-74: Ability to configure the Servlet Context Path
Browse files Browse the repository at this point in the history
  • Loading branch information
vmassol committed Nov 28, 2019
1 parent cdbf86e commit 633cc1b
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 71 deletions.
2 changes: 2 additions & 0 deletions 10/mysql-tomcat/Dockerfile
Expand Up @@ -89,6 +89,8 @@ VOLUME /usr/local/xwiki
# hibernate.cfg.xml file.
# - DB_HOST: The name of the host (or docker container) containing the database. Default is "db". This is used to
# configure xwiki's hibernate.cfg.xml file.
# - CONTEXT_PATH: The name of the context path under which XWiki will be deployed in Tomcat. If not specified then it'll
# be deployed as ROOT.

# Example:
# docker run -it -e "DB_USER=xwiki" -e "DB_PASSWORD=xwiki" <imagename>
Expand Down
34 changes: 20 additions & 14 deletions 10/mysql-tomcat/xwiki/docker-entrypoint.sh
Expand Up @@ -23,7 +23,7 @@ set -e

function first_start() {
configure
touch /usr/local/tomcat/webapps/ROOT/.first_start_completed
touch /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed
}

function other_starts() {
Expand All @@ -43,13 +43,13 @@ function xwiki_replace() {
# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_cfg() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.cfg "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.cfg "$1" "$2"
}

# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_properties() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.properties "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.properties "$1" "$2"
}

# usage: file_env VAR [DEFAULT]
Expand Down Expand Up @@ -86,21 +86,21 @@ function safesed {
function saveConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Reusing existing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " Saving config file $1..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

# $1 - the config file name to restore in WEB-INF (e.g. "xwiki.cfg")
function restoreConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Synchronizing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " No config file $1 found, using default from container..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

Expand All @@ -115,17 +115,22 @@ function configure() {
file_env 'INDEX_HOST' 'localhost'
file_env 'INDEX_PORT' '8983'

echo " Deploying XWiki in the $CONTEXT_PATH context"
if [ "$CONTEXT_PATH" == "ROOT" ]; then
xwiki_set_cfg 'xwiki.webapppath' ''
else
mv /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/$CONTEXT_PATH
fi

echo 'Replacing environment variables in files'
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml

echo ' Generating authentication validation and encryption keys...'
xwiki_set_cfg 'xwiki.authentication.validationKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
xwiki_set_cfg 'xwiki.authentication.encryptionKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
echo ' Deploying XWiki in the ROOT context'
xwiki_set_cfg 'xwiki.webapppath' ""

echo ' Setting permanent directory...'
xwiki_set_properties 'environment.permanentDirectory' '/usr/local/xwiki/data'
Expand Down Expand Up @@ -155,7 +160,8 @@ fi

# Check for the expected command
if [ "$1" = 'xwiki' ]; then
if [[ ! -f /usr/local/tomcat/webapps/ROOT/.first_start_completed ]]; then
file_env 'CONTEXT_PATH' 'ROOT'
if [[ ! -f /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed ]]; then
first_start
else
other_starts
Expand Down
2 changes: 2 additions & 0 deletions 10/postgres-tomcat/Dockerfile
Expand Up @@ -89,6 +89,8 @@ VOLUME /usr/local/xwiki
# hibernate.cfg.xml file.
# - DB_HOST: The name of the host (or docker container) containing the database. Default is "db". This is used to
# configure xwiki's hibernate.cfg.xml file.
# - CONTEXT_PATH: The name of the context path under which XWiki will be deployed in Tomcat. If not specified then it'll
# be deployed as ROOT.

# Example:
# docker run -it -e "DB_USER=xwiki" -e "DB_PASSWORD=xwiki" <imagename>
Expand Down
34 changes: 20 additions & 14 deletions 10/postgres-tomcat/xwiki/docker-entrypoint.sh
Expand Up @@ -23,7 +23,7 @@ set -e

function first_start() {
configure
touch /usr/local/tomcat/webapps/ROOT/.first_start_completed
touch /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed
}

function other_starts() {
Expand All @@ -43,13 +43,13 @@ function xwiki_replace() {
# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_cfg() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.cfg "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.cfg "$1" "$2"
}

# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_properties() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.properties "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.properties "$1" "$2"
}

# usage: file_env VAR [DEFAULT]
Expand Down Expand Up @@ -86,21 +86,21 @@ function safesed {
function saveConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Reusing existing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " Saving config file $1..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

# $1 - the config file name to restore in WEB-INF (e.g. "xwiki.cfg")
function restoreConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Synchronizing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " No config file $1 found, using default from container..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

Expand All @@ -115,17 +115,22 @@ function configure() {
file_env 'INDEX_HOST' 'localhost'
file_env 'INDEX_PORT' '8983'

echo " Deploying XWiki in the $CONTEXT_PATH context"
if [ "$CONTEXT_PATH" == "ROOT" ]; then
xwiki_set_cfg 'xwiki.webapppath' ''
else
mv /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/$CONTEXT_PATH
fi

echo 'Replacing environment variables in files'
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml

echo ' Generating authentication validation and encryption keys...'
xwiki_set_cfg 'xwiki.authentication.validationKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
xwiki_set_cfg 'xwiki.authentication.encryptionKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
echo ' Deploying XWiki in the ROOT context'
xwiki_set_cfg 'xwiki.webapppath' ""

echo ' Setting permanent directory...'
xwiki_set_properties 'environment.permanentDirectory' '/usr/local/xwiki/data'
Expand Down Expand Up @@ -155,7 +160,8 @@ fi

# Check for the expected command
if [ "$1" = 'xwiki' ]; then
if [[ ! -f /usr/local/tomcat/webapps/ROOT/.first_start_completed ]]; then
file_env 'CONTEXT_PATH' 'ROOT'
if [[ ! -f /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed ]]; then
first_start
else
other_starts
Expand Down
2 changes: 2 additions & 0 deletions 11/mysql-tomcat/Dockerfile
Expand Up @@ -89,6 +89,8 @@ VOLUME /usr/local/xwiki
# hibernate.cfg.xml file.
# - DB_HOST: The name of the host (or docker container) containing the database. Default is "db". This is used to
# configure xwiki's hibernate.cfg.xml file.
# - CONTEXT_PATH: The name of the context path under which XWiki will be deployed in Tomcat. If not specified then it'll
# be deployed as ROOT.

# Example:
# docker run -it -e "DB_USER=xwiki" -e "DB_PASSWORD=xwiki" <imagename>
Expand Down
34 changes: 20 additions & 14 deletions 11/mysql-tomcat/xwiki/docker-entrypoint.sh
Expand Up @@ -23,7 +23,7 @@ set -e

function first_start() {
configure
touch /usr/local/tomcat/webapps/ROOT/.first_start_completed
touch /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed
}

function other_starts() {
Expand All @@ -43,13 +43,13 @@ function xwiki_replace() {
# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_cfg() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.cfg "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.cfg "$1" "$2"
}

# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_properties() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.properties "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.properties "$1" "$2"
}

# usage: file_env VAR [DEFAULT]
Expand Down Expand Up @@ -86,21 +86,21 @@ function safesed {
function saveConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Reusing existing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " Saving config file $1..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

# $1 - the config file name to restore in WEB-INF (e.g. "xwiki.cfg")
function restoreConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Synchronizing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " No config file $1 found, using default from container..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

Expand All @@ -115,17 +115,22 @@ function configure() {
file_env 'INDEX_HOST' 'localhost'
file_env 'INDEX_PORT' '8983'

echo " Deploying XWiki in the $CONTEXT_PATH context"
if [ "$CONTEXT_PATH" == "ROOT" ]; then
xwiki_set_cfg 'xwiki.webapppath' ''
else
mv /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/$CONTEXT_PATH
fi

echo 'Replacing environment variables in files'
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml

echo ' Generating authentication validation and encryption keys...'
xwiki_set_cfg 'xwiki.authentication.validationKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
xwiki_set_cfg 'xwiki.authentication.encryptionKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
echo ' Deploying XWiki in the ROOT context'
xwiki_set_cfg 'xwiki.webapppath' ""

echo ' Setting permanent directory...'
xwiki_set_properties 'environment.permanentDirectory' '/usr/local/xwiki/data'
Expand Down Expand Up @@ -155,7 +160,8 @@ fi

# Check for the expected command
if [ "$1" = 'xwiki' ]; then
if [[ ! -f /usr/local/tomcat/webapps/ROOT/.first_start_completed ]]; then
file_env 'CONTEXT_PATH' 'ROOT'
if [[ ! -f /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed ]]; then
first_start
else
other_starts
Expand Down
2 changes: 2 additions & 0 deletions 11/postgres-tomcat/Dockerfile
Expand Up @@ -89,6 +89,8 @@ VOLUME /usr/local/xwiki
# hibernate.cfg.xml file.
# - DB_HOST: The name of the host (or docker container) containing the database. Default is "db". This is used to
# configure xwiki's hibernate.cfg.xml file.
# - CONTEXT_PATH: The name of the context path under which XWiki will be deployed in Tomcat. If not specified then it'll
# be deployed as ROOT.

# Example:
# docker run -it -e "DB_USER=xwiki" -e "DB_PASSWORD=xwiki" <imagename>
Expand Down
34 changes: 20 additions & 14 deletions 11/postgres-tomcat/xwiki/docker-entrypoint.sh
Expand Up @@ -23,7 +23,7 @@ set -e

function first_start() {
configure
touch /usr/local/tomcat/webapps/ROOT/.first_start_completed
touch /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed
}

function other_starts() {
Expand All @@ -43,13 +43,13 @@ function xwiki_replace() {
# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_cfg() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.cfg "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.cfg "$1" "$2"
}

# $1 - the setting/property to set
# $2 - the new value
function xwiki_set_properties() {
xwiki_replace /usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.properties "$1" "$2"
xwiki_replace /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/xwiki.properties "$1" "$2"
}

# usage: file_env VAR [DEFAULT]
Expand Down Expand Up @@ -86,21 +86,21 @@ function safesed {
function saveConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Reusing existing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " Saving config file $1..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

# $1 - the config file name to restore in WEB-INF (e.g. "xwiki.cfg")
function restoreConfigurationFile() {
if [ -f "/usr/local/xwiki/data/$1" ]; then
echo " Synchronizing config file $1..."
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1"
cp "/usr/local/xwiki/data/$1" "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1"
else
echo " No config file $1 found, using default from container..."
cp "/usr/local/tomcat/webapps/ROOT/WEB-INF/$1" "/usr/local/xwiki/data/$1"
cp "/usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/$1" "/usr/local/xwiki/data/$1"
fi
}

Expand All @@ -115,17 +115,22 @@ function configure() {
file_env 'INDEX_HOST' 'localhost'
file_env 'INDEX_PORT' '8983'

echo " Deploying XWiki in the $CONTEXT_PATH context"
if [ "$CONTEXT_PATH" == "ROOT" ]; then
xwiki_set_cfg 'xwiki.webapppath' ''
else
mv /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/$CONTEXT_PATH
fi

echo 'Replacing environment variables in files'
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
safesed "replaceuser" $DB_USER /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacepassword" $DB_PASSWORD /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacecontainer" $DB_HOST /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml
safesed "replacedatabase" $DB_DATABASE /usr/local/tomcat/webapps/$CONTEXT_PATH/WEB-INF/hibernate.cfg.xml

echo ' Generating authentication validation and encryption keys...'
xwiki_set_cfg 'xwiki.authentication.validationKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
xwiki_set_cfg 'xwiki.authentication.encryptionKey' "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
echo ' Deploying XWiki in the ROOT context'
xwiki_set_cfg 'xwiki.webapppath' ""

echo ' Setting permanent directory...'
xwiki_set_properties 'environment.permanentDirectory' '/usr/local/xwiki/data'
Expand Down Expand Up @@ -155,7 +160,8 @@ fi

# Check for the expected command
if [ "$1" = 'xwiki' ]; then
if [[ ! -f /usr/local/tomcat/webapps/ROOT/.first_start_completed ]]; then
file_env 'CONTEXT_PATH' 'ROOT'
if [[ ! -f /usr/local/tomcat/webapps/$CONTEXT_PATH/.first_start_completed ]]; then
first_start
else
other_starts
Expand Down

0 comments on commit 633cc1b

Please sign in to comment.