feat: define configuration for ssh and mirror key
This commit is contained in:
parent
50b3b5ef68
commit
28609af439
1 changed files with 10 additions and 4 deletions
|
@ -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 "$@"
|
||||
|
||||
|
|
Loading…
Reference in a new issue