ops: move to forgejo-primary hosting with mirror-only codeberg/github
This commit is contained in:
parent
a5bc6c5226
commit
043b1730dc
18 changed files with 336 additions and 66 deletions
23
scripts/git-push-mirrors.sh
Executable file
23
scripts/git-push-mirrors.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "${root}"
|
||||
|
||||
branch="${EVERY_CHANNEL_MIRROR_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}"
|
||||
push_tags="${EVERY_CHANNEL_MIRROR_PUSH_TAGS:-true}"
|
||||
remotes="${EVERY_CHANNEL_MIRROR_REMOTES:-mirror-codeberg mirror-github}"
|
||||
|
||||
for remote in ${remotes}; do
|
||||
if ! git remote get-url "${remote}" >/dev/null 2>&1; then
|
||||
echo "warn: remote not configured, skipping: ${remote}" >&2
|
||||
continue
|
||||
fi
|
||||
echo "sync: ${remote} (${branch})"
|
||||
git push "${remote}" "${branch}:${branch}"
|
||||
if [[ "${push_tags}" == "true" || "${push_tags}" == "1" ]]; then
|
||||
git push "${remote}" --tags
|
||||
fi
|
||||
done
|
||||
|
||||
echo "ok: mirror push complete"
|
||||
Loading…
Add table
Add a link
Reference in a new issue