diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 03186fe..aaa28c8 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -17,11 +17,11 @@ fi ## Check existing variables if [ -z "$GITIT_USER_EMAIL" ]; then - 2>& echo "ERROR: Environment variable GITIT_USER_EMAIL not defined" + >&2 echo "ERROR: Environment variable GITIT_USER_EMAIL not defined" exit 1 fi if [ -z "$GITIT_USER_NAME" ]; then - 2>& echo "ERROR: Environment variable GITIT_USER_NAME not defined" + >&2 echo "ERROR: Environment variable GITIT_USER_NAME not defined" exit 1 fi @@ -40,9 +40,16 @@ git config --global user.name "$GITIT_USER_NAME" if [ -n "$GITIT_REMOTE_REPOSITORY" ]; then if [ -z "$GITIT_REMOTE_DOMAIN" ]; then - 2>& echo "ERROR: Environment variable GITIT_REMOTE_DOMAIN not defined" + >&2 echo "ERROR: Environment variable GITIT_REMOTE_DOMAIN not defined" exit 1 fi + mkdir -p /data/ssh + if [ ! -f /data/ssh/mirror_rsa ]; then + >&2 echo "ERROR: SSH Key file /data/ssh/mirror_rsa is missing." + >&2 echo " Please create it with 'ssh-keygen -f /data/ssh/mirror_rsa' ." + exit 1 + fi + git remote remove origin git remote add origin "$GITIT_REMOTE_REPOSITORY" @@ -62,6 +69,5 @@ if [ "$1" = 'gitit' ]; then exec gitit "$@" fi - exec "$@"