Use ssh password when mirroring

This commit is contained in:
Bob Mottram 2016-01-27 14:20:32 +00:00
parent 92634e34ab
commit ef3f16d065
1 changed files with 11 additions and 2 deletions

View File

@ -164,13 +164,22 @@ function sync_trove_repos {
fi
fi
if [ ! -d /home/trove/${trove_name} ]; then
git clone --mirror ${repo_url} /home/trove/${trove_name}
if [[ ${repo_url} != 'ssh:'* ]]; then
git clone --mirror ${repo_url} /home/trove/${trove_name}
else
sshpass -p "$FRIENDS_TROVE_PASSWORD" git clone --mirror ${repo_url} /home/trove/${trove_name}
fi
if [ ! -d /home/trove/${trove_name} ]; then
echo $"WARNING: failed to mirror repo ${repo_url}"
fi
else
cd /home/trove/${trove_name}
git fetch -p origin
git remote set-url origin ${repo_url}
if [[ ${repo_url} != 'ssh:'* ]]; then
git fetch -p origin
else
sshpass -p "$FRIENDS_TROVE_PASSWORD" git fetch -p origin
fi
fi
done
chown -R trove:trove /home/trove