2018-02-08 15:09:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# library made for sourcing - just to prepare git auth environment
|
|
|
|
|
|
|
|
function prepareGitAuth(){
|
|
|
|
# usage
|
|
|
|
# $1 - config directory
|
|
|
|
confdir=$1/auth
|
|
|
|
[ -d $confdir ] || mkdir $confdir
|
|
|
|
[ -d $confdir/ssh ] || mkdir $confdir/ssh
|
|
|
|
|
2018-02-23 10:17:37 +01:00
|
|
|
chmod 0700 $confdir
|
2018-02-08 15:09:47 +01:00
|
|
|
|
|
|
|
# git configure http authenticator
|
|
|
|
git config --global credential.helper "store --file=$confdir/git-credentials"
|
|
|
|
# git configure ssh auth
|
2018-02-09 11:48:51 +01:00
|
|
|
git config --global core.sshcommand "ssh -i $confdir/ssh/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -q"
|
2018-02-08 15:09:47 +01:00
|
|
|
}
|
|
|
|
|