From ed88c630ea527d87b7b56fca60e50997a0fab578 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 14 Jan 2019 13:18:47 +0000 Subject: [PATCH] Add the git-mirror script uses on Jenkins This is run on one of Jenkins Linux machines to mirror all the SF repos for faster cloning and builds when SF is offline. --- update_git_mirror.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 update_git_mirror.sh diff --git a/update_git_mirror.sh b/update_git_mirror.sh new file mode 100755 index 0000000..f94bead --- /dev/null +++ b/update_git_mirror.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +mirror_dirs='fgdata fgmeta flightgear simgear getstart windows-3rd-party fgrun' + +pushd /var/lib/git + +for dir in $mirror_dirs +do + repo_name=$dir.git + if [ ! -d "$repo_name" ]; then + echo "Doing initial clone" + git clone --mirror git://git.code.sf.net/p/flightgear/$dir + fi + + pushd $repo_name + echo "Updating in $PWD" + git remote update + popd +done + +popd +