Commit 1bb67b1f authored by benedikt.kroening's avatar benedikt.kroening
Browse files

Fixed singlenode docker image

Singlenode docker image now includes OX Core, Guard, Documents (withs collaboration server) and the Document converter
parent 67a78196
......@@ -75,6 +75,10 @@ In order to build an singlenode image execute the build script:
`$ docker/build.sh --singlenode`
This will automatically install OX App Suite, Guard, Documents (including documents collaboration) and the documentconverter server.
The image will be tagged with the `AS_BACKEND_VERSION`-variable (setup/versions) and the `latest` tag on each build.
### Start it
If you have docker-compose available you can use it to start the provided compose-environment, but make sure to be in the correct directory.
......
#!/bin/bash
#
# Copyright (C) 2019 OX Software GmbH
#
# This file is part of OX Automation.
#
# OX Automation is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OX Automation is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OX Automation. If not, see <http://www.gnu.org/licenses/>.
#
#
# Authors:
# Benedikt Kroening <benedikt.kroening@open-xchange.com>
#
set -e
SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P)"
# sourcing some commonly used functions and executing basic checks
source ${SCRIPT_DIR}/../lib/common.bash
checkRootPrivileges
detectDistribution
## Help text
show_usage() {
echo -n "
$0 [OPTIONS]
"
}
### reading config from command line; overriding defaults
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
show_usage
exit 0
shift
;;
--debug)
echo "WARNING: Debug flag set (--debug)"
set -x
shift
;;
# -g|--middleware)
# INSTALL_MIDDLEWARE=true
# shift
# ;;
# --guard)
# INSTALL_GUARD=true
# shift
# ;;
# --documents)
# INSTALL_DOCUMENTS=true
# shift
# ;;
# --repo-guard)
# OX_REPO_GUARD="$2"
# echo "WARNING: Using $OX_REPO_GUARD as guard repository source"
# shift
# shift
# ;;
*) # unknown option
echo "Unknonwn option: $1"
POSITIONAL+=("$1") # save it in an array for later
shift
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# echo "Copying default config ..."
# cp -f ${SCRIPT_DIR}/frontend/conf/*.conf ${HTTPD_CONF_PATH}
# restartService ${HTTPD}
INIT_STATE_FILE="/opt/open-xchange/etc/01-init-documents-collaboration-done"
if [ ! -f ${INIT_STATE_FILE} ]; then
${SCRIPT_DIR}/../features/documents-collaboration.sh --enable --server
echo "$(date)" > ${INIT_STATE_FILE}
else
echo "WARNING: This scripts has already been executed and will be skipped!"
sleep 5
fi
[program:open-xchange-documentconverter-server]
process_name=open-xchange-documentconverter-server
directory=/opt/open-xchange/documentconverter
stopwaitsecs=30
command=/ox-installer/config/init-documents-collaboration.sh && /opt/open-xchange/documentconverter/sbin/open-xchange-documentconverter
user=open-xchange
# Do not set to true!
autostart=false
\ No newline at end of file
[program:open-xchange-documents-collaboration]
process_name=open-xchange-documents-collaboration
directory=/usr/share/open-xchange-documents-collaboration/
stopwaitsecs=30
command=/usr/share/open-xchange-documents-collaboration/bin/com.openexchange.office.dcs -Duser.timezone=UTC --spring.config.location=file:/etc/documents-collaboration/dcs.properties --logging.config=/etc/documents-collaboration/logback-spring.xml
user=open-xchange
# Do not set to true!
autostart=false
\ No newline at end of file
......@@ -31,7 +31,8 @@ source ${SCRIPT_DIR}/../lib/common.bash
show_usage() {
echo -n "
Build docker images with the help of the ox-installer scripts
Build docker images with the help of the ox-installer scripts.
NOTE: Review the configuration used in the respective folder: singlenode/config or cluster/config
Easiest way to get a working image:
$ ${0}
......@@ -130,28 +131,38 @@ if [[ -z "${INSTALL_TYPE}" ]]; then
exit 99
fi
# sourcing Versions to use from file for tagging
exportProperties ${SCRIPT_DIR}/../setup/versions
echo "Config to be used:"
echo "============================================"
grep -v '^#' ${SCRIPT_DIR}/${INSTALL_TYPE}/config
echo "============================================"
echo "NOTE: You may want to review the configuration: ${SCRIPT_DIR}/${INSTALL_TYPE}/config before building the images!"
echo "CTRL+C to cancel ..."
echo ""
sleep 3
STARTED_AT=$(date)
if [[ "${INSTALL_TYPE}" == "singlenode" ]]; then
# ensure that all components will be "force" installed if on singlenode
exportProperties ${SCRIPT_DIR}/singlenode/config
docker build --no-cache --rm \
--build-arg ARG_INSTALL_FRONTEND=true \
--build-arg ARG_INSTALL_MIDDLEWARE=true \
--build-arg ARG_INSTALL_GUARD=true \
--build-arg ARG_INSTALL_DOCUMENTS=false \
--build-arg ARG_INSTALL_DOCUMENTCONVERTER=false \
-f ${SCRIPT_DIR}/singlenode/Dockerfile \
-t singlenode:latest ${SCRIPT_DIR}/../
-t singlenode:${AS_BACKEND_VERSION} ${SCRIPT_DIR}/../
docker tag singlenode:${AS_BACKEND_VERSION} singlenode:latest
elif [[ "${INSTALL_TYPE}" == "cluster" ]]; then
#exportProperties ${SCRIPT_DIR}/cluster/config
# TODO: propper image tag versioning
exportProperties ${SCRIPT_DIR}/singlenode/config
exportProperties ${SCRIPT_DIR}/cluster/config
echo "Building OX frontend image ..."
docker build --no-cache --rm -f ${SCRIPT_DIR}/cluster/frontend.Dockerfile -t open-xchange-frontend:latest ${SCRIPT_DIR}/../
docker build --no-cache --rm -f ${SCRIPT_DIR}/cluster/frontend.Dockerfile -t open-xchange-frontend${AS_BACKEND_VERSION} ${SCRIPT_DIR}/../
echo "Building OX middleware image ..."
docker build --no-cache --rm -f ${SCRIPT_DIR}/cluster/middleware.Dockerfile -t open-xchange-middleware:latest ${SCRIPT_DIR}/../
docker build --no-cache --rm -f ${SCRIPT_DIR}/cluster/middleware.Dockerfile -t open-xchange-middleware${AS_BACKEND_VERSION} ${SCRIPT_DIR}/../
else
# let the environment variables do the selection magic
......
......@@ -16,6 +16,8 @@ DATABASE_HOST_NAME=database
DATABASE_ROOT_USER=root
DATABASE_ROOT_PASS=secret
DATABASE_HOST_PORT=3306
# do not set this flag to true!
INSTALL_DATABASE=false
# OX Backend specific configuration
OX_ADMINMASTER_USER=oxadminmaster
......@@ -29,7 +31,11 @@ OX_CONFIGDB_NAME=configdb
# Default setup settings
# This will install a basic singlenode setup
INSTALL_MIDDLEWARE=true
INSTALL_FRONTEND=true
INSTALL_GUARD=true
INSTALL_DOCUMENTS=true
INSTALL_DOCUMENTCONVERTER=true
OX_ENV_QA=true
......
......@@ -125,16 +125,17 @@ if [ "$INSTALL_DOCUMENTCONVERTER" = true ] ; then
echo "Adding OX documentconverter server packages ..."
PACKAGES="readerengine open-xchange-documentconverter-server open-xchange-documentconverter-api "
installPackages ${PACKAGES}
restartService open-xchange-documentconverter-server
sleep 5
fi
# client will be installed by documents, frontned does not require packages
fi
if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
if [[ "${DOCUMENTCONVERTER_ENABLE}" = true ]]; then
restartService open-xchange-documentconverter-server
sleep 5
INIT_STATE_FILE="/opt/open-xchange/etc/21-init-documentconverter-done"
if [ ! -f ${INIT_STATE_FILE} ]; then
# waitPort 8008 oder so?
if [[ "${SERVER}" = true ]]; then
echo "Doing some dc-server config"
......
#!/bin/bash
#
# Copyright (C) 2019 OX Software GmbH
......@@ -140,17 +139,23 @@ if [ "$INSTALL_DOCUMENTS" = true ] ; then
fi
installPackages ${PACKAGES}
# Updating UI themes if script exists
if [[ -f /opt/open-xchange/appsuite/share/update-themes.sh ]]; then
/opt/open-xchange/appsuite/share/update-themes.sh
fi
fi
# Install and enable Documents collaboration server, client comes below
if [ "$INSTALL_DCS" = true ] ; then
${SCRIPT_DIR}/documents-collaboration.sh --install --enable --server
${SCRIPT_DIR}/documents-collaboration.sh --install --server
fi
if [[ "${DOCUMENTS_ENABLE}" = true ]]; then
# Updating UI themes if script exists
if [[ -f /opt/open-xchange/appsuite/share/update-themes.sh ]]; then
/opt/open-xchange/appsuite/share/update-themes.sh
#
if [[ -f /usr/share/open-xchange-documents-collaboration/bin/initdcsdb.sh ]]; then
${SCRIPT_DIR}/../config/init-documents-collaboration.sh
fi
# The documents collaboration client requires some special config
${SCRIPT_DIR}/documents-collaboration.sh --enable --client --restart
......
......@@ -146,6 +146,11 @@ if [ "$INSTALL_GUARD" = true ] ; then
fi
installPackages ${PACKAGES}
# Updating UI themes if script exists
if [[ -f /opt/open-xchange/appsuite/share/update-themes.sh ]]; then
/opt/open-xchange/appsuite/share/update-themes.sh
fi
fi
......@@ -158,8 +163,7 @@ if [[ "${GUARD_ENABLE}" = true ]]; then
if [[ "${INSTALL_FRONTEND}" = true ]]; then
echo "Adding Guard proxy rules ..."
cp -f ${SCRIPT_DIR}/../config/frontend/conf/89_guard-proxy.dummy ${HTTPD_CONF_PATH}/89_guard-proxy.conf
/opt/open-xchange/appsuite/share/update-themes.sh
if [[ "${INSTALL_TYPE}" == *"singlenode"* ]]; then
# Creating guard config with higher prios for apache config (load order)
${SCRIPT_DIR}/../config/frontend/add-balancer.sh \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment