Skip to content

Commit 2dd3ad0

Browse files
committed
[Docker] Adapt docker entrypoint for new config file structure
1 parent 78f51a4 commit 2dd3ad0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

docker/docker-entrypoint.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,36 @@
1515
# limitations under the License.
1616
#
1717

18-
CONF_FILE="${FLUSS_HOME}/conf/server.yaml"
18+
COMMON_CONF_FILE="${FLUSS_HOME}/conf/common.yaml"
1919

2020
prepare_configuration() {
21+
additional_conf_file="${FLUSS_HOME}/conf/$1"
22+
2123
if [ -n "${FLUSS_PROPERTIES}" ]; then
22-
echo "${FLUSS_PROPERTIES}" >> "${CONF_FILE}"
24+
# copy over all configuration options of FLUSS_PROPERTIES to the common and the additional configuration file
25+
# since we cannot tell which configuration options are specific and which are not
26+
echo "#==============================================================================" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file"
27+
echo "# Configuration Options from FLUSS_PROPERTIES Environment Variable" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file"
28+
echo "#==============================================================================" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file"
29+
echo "${FLUSS_PROPERTIES}" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file"
2330
fi
24-
envsubst < "${CONF_FILE}" > "${CONF_FILE}.tmp" && mv "${CONF_FILE}.tmp" "${CONF_FILE}"
31+
envsubst < "${COMMON_CONF_FILE}" > "${COMMON_CONF_FILE}.tmp" && mv "${COMMON_CONF_FILE}.tmp" "${COMMON_CONF_FILE}"
32+
envsubst < "$additional_conf_file" > "$additional_conf_file.tmp" && mv "$additional_conf_file.tmp" "$additional_conf_file"
2533
}
2634

27-
prepare_configuration
28-
2935
args=("$@")
3036

3137
if [ "$1" = "help" ]; then
3238
printf "Usage: $(basename "$0") (coordinatorServer|tabletServer)\n"
3339
printf " Or $(basename "$0") help\n\n"
3440
exit 0
3541
elif [ "$1" = "coordinatorServer" ]; then
42+
prepare_configuration "coordinator-server.yaml"
3643
args=("${args[@]:1}")
3744
echo "Starting Coordinator Server"
3845
exec "$FLUSS_HOME/bin/coordinator-server.sh" start-foreground "${args[@]}"
3946
elif [ "$1" = "tabletServer" ]; then
47+
prepare_configuration "tablet-server.yaml"
4048
args=("${args[@]:1}")
4149
echo "Starting Tablet Server"
4250
exec "$FLUSS_HOME/bin/tablet-server.sh" start-foreground "${args[@]}"

0 commit comments

Comments
 (0)