chore(scripts): add mirror script for future CI use

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
This commit is contained in:
Andrei Jiroh Halili 2023-07-29 01:03:35 +08:00
parent 0986f70031
commit 57331896ab
Signed by: ajhalili2006
GPG Key ID: 67BFC91B3DA12BE8
1 changed files with 20 additions and 1 deletions

View File

@ -1,9 +1,28 @@
#!/usr/bin/env bash
set -xe
# SPDX-License-Identifier: MPL-2.0
set -x
export GIT_TRACE=1 GIT_TRANSFER_TRACE=1 GIT_CURL_VERBOSE=1
REPOS="lab vern hub keybase"
branch="$(git rev-parse --abbrev-ref HEAD)"
for remote in $REPOS; do
# WORKAROUND: git config workaround to make lfs mirroring work outside Keybase.
if [[ $remote == "keybase" ]]; then
git config lfs.standalonetransferagent keybase-lfs
git config --replace-all lfs.lfs.customtransfer.keybase-lfs.path "git-remote-keybase"
git config --replace-all lfs.customtransfer.keybase-lfs.args "lfs origin keybase://private/ajhalili2006/digital-garden"
fi
git lfs push $remote $branch --all
git push $remote $branch
# workaround: needed to avoid erroring out by git when still working on markdown files.
if [[ $remote == "keybase" ]]; then
git config --unset lfs.standalonetransferagent
fi
done
unset GIT_TRACE GIT_CURL_VERBOSE GIT_TRANSFER_TRACE