From 846298e0a7e80a7bf53b2acf9d1bd711b2dd3678 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Wed, 27 Jan 2021 15:03:28 +0100 Subject: [PATCH] Use environement variables for user settings --- docker-entrypoint.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 35f5983..bcc2087 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,15 +9,26 @@ if [ ! -f /data/gitit.conf ]; then sed -i 's|default-extension: page|default-extension: md|' /data/gitit.conf fi +## Check existing variables +if [ -z "$GITIT_USER_EMAIL" ]; then + exit 1 +fi +if [ -z "$GITIT_USER_NAME" ]; then + exit 1 +fi + # Configure GIT CUR="$(pwd)" cd /data/wikidata + if [ ! -d /data/wikidata/.git ]; then git init fi git config diff.renames false -git config --global user.email "admin@localhost" -git config --global user.name "Admin From Localhost" + + +git config --global user.email "$GITIT_USER_EMAIL" +git config --global user.name "$GITIT_USER_NAME" cd "$CUR"