service-gitit/docker-entrypoint.sh

43 lines
671 B
Bash
Raw Normal View History

2019-02-19 10:05:42 +00:00
#!/bin/sh
set -e
if [ ! -f /data/gitit.conf ]; then
echo "Building config for gitit"
gitit --print-default-config > /data/gitit.conf
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
2019-03-11 23:36:08 +00:00
# Configure GIT
CUR="$(pwd)"
2021-01-27 14:15:34 +00:00
mkdir -p /data/wikidata
2019-03-11 23:36:08 +00:00
cd /data/wikidata
2019-03-11 23:36:08 +00:00
if [ ! -d /data/wikidata/.git ]; then
git init
fi
git config diff.renames false
git config --global user.email "$GITIT_USER_EMAIL"
git config --global user.name "$GITIT_USER_NAME"
2019-03-11 23:36:08 +00:00
cd "$CUR"
2019-02-19 10:05:42 +00:00
if [ "$1" = 'gitit' ]; then
exec gitit "$@"
fi
2019-03-11 23:36:08 +00:00
2019-02-19 10:05:42 +00:00
exec "$@"