removed unknown flag

This commit is contained in:
Leopere 2018-11-11 21:20:04 -05:00 committed by Mark Beamer Jr
parent 74d6cc34fe
commit 97b29f354c
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973
2 changed files with 5 additions and 4 deletions

View file

@ -34,7 +34,7 @@ COPY stuff/chainqueryconfig.toml /etc/chainquery/
## Get latest chainqueryconfig.toml from master on github as template. ## Get latest chainqueryconfig.toml from master on github as template.
# TODO: add magic which pattern matches for chainqueryconfig.toml DEFAULT strings and replaces them with configured settings on container start. # TODO: add magic which pattern matches for chainqueryconfig.toml DEFAULT strings and replaces them with configured settings on container start.
ADD --chown=1000:1000 https://raw.githubusercontent.com/lbryio/chainquery/master/config/default/chainqueryconfig.toml /etc/chainquery/chainqueryconfig.toml.orig ADD https://raw.githubusercontent.com/lbryio/chainquery/master/config/default/chainqueryconfig.toml /etc/chainquery/chainqueryconfig.toml.orig
## Install start.sh as executable script in container $PATH ## Install start.sh as executable script in container $PATH
COPY stuff/start.sh /usr/local/bin/start COPY stuff/start.sh /usr/local/bin/start

View file

@ -22,21 +22,22 @@ CONFIG_SETTINGS=(
APIMYSQLDSN APIMYSQLDSN
) )
function set_configs(parameter) { function set_configs() {
## Set configs on container start if not already set. ## Set configs on container start if not already set.
for i in "${!CONFIG_SETTINGS[@]}"; do for i in "${!CONFIG_SETTINGS[@]}"; do
echo ${CONFIG_SETTINGS[$i]}"_KEY"
## Indirect references http://tldp.org/LDP/abs/html/ivr.html ## Indirect references http://tldp.org/LDP/abs/html/ivr.html
eval FROM_STRING=\$"${CONFIG_SETTINGS[$i]}_DEFAULT" eval FROM_STRING=\$"${CONFIG_SETTINGS[$i]}_DEFAULT"
eval TO_STRING=\$${CONFIG_SETTINGS[$i]} eval TO_STRING=\$${CONFIG_SETTINGS[$i]}
## TODO: Add a bit more magic to make sure that you're only configuring things if not set by config mounts. ## TODO: Add a bit more magic to make sure that you're only configuring things if not set by config mounts.
sed -i '' "s/$FROM_STRING/$TO_STRING/g" /etc/chainquery/chainqueryconfig.toml sed -i '' "s~$FROM_STRING~$TO_STRING~g" /etc/chainquery/chainqueryconfig.toml
done done
} }
if [[ ! -f /etc/chainquery/chainqueryconfig.toml ]]; then if [[ ! -f /etc/chainquery/chainqueryconfig.toml ]]; then
echo "[INFO]: Found no chainqueryconfig.toml" echo "[INFO]: Found no chainqueryconfig.toml"
echo " Installing default and configuring with provided environment variables if any." echo " Installing default and configuring with provided environment variables if any."
## Install fresh copy of config file.
cp /etc/chainquery/chainqueryconfig.toml.orig /etc/chainquery/chainqueryconfig.toml
set_configs set_configs
else else
echo "[INFO]: Found a copy of chainqueryconfig.toml in /etc/chainquery" echo "[INFO]: Found a copy of chainqueryconfig.toml in /etc/chainquery"