mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 12:42:50 +00:00
add sync script for git-repo
This commit is contained in:
parent
344a96bf0a
commit
202690620b
21
git-repo.sh
Executable file
21
git-repo.sh
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://gerrit.googlesource.com/git-repo"}
|
||||||
|
|
||||||
|
function repo_init() {
|
||||||
|
git clone --mirror $UPSTREAM $TUNASYNC_WORKING_DIR
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_repo_git() {
|
||||||
|
cd $TUNASYNC_WORKING_DIR
|
||||||
|
echo "==== SYNC repo.git START ===="
|
||||||
|
/usr/bin/timeout -s INT 3600 git remote -v update
|
||||||
|
git repack -a -b -d
|
||||||
|
echo "==== SYNC repo.git DONE ===="
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -f "$TUNASYNC_WORKING_DIR/HEAD" ]]; then
|
||||||
|
echo "Initializing repo.git mirror"
|
||||||
|
repo_init
|
||||||
|
fi
|
||||||
|
|
||||||
|
update_repo_git
|
Loading…
x
Reference in New Issue
Block a user