aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/22_forge/files/git-shell-commands/mirror-from
diff options
context:
space:
mode:
authorJan Sydänviita <jan@sydanviita.fi>2026-08-21 16:12:48 +0300
committerJan Sydänviita <jan@sydanviita.fi>2026-08-21 16:12:48 +0300
commit07b45bc892b636dd55472d0a4510c0b064418c01 (patch)
tree0ba0470bbbd6e680a1eb8e396058d4b07a66f5ab /roles/jails/22_forge/files/git-shell-commands/mirror-from
parent6f1ab23e5e4210e8167011e0fea1e1504fdd566e (diff)
Update forge
Diffstat (limited to 'roles/jails/22_forge/files/git-shell-commands/mirror-from')
-rw-r--r--roles/jails/22_forge/files/git-shell-commands/mirror-from44
1 files changed, 0 insertions, 44 deletions
diff --git a/roles/jails/22_forge/files/git-shell-commands/mirror-from b/roles/jails/22_forge/files/git-shell-commands/mirror-from
deleted file mode 100644
index 2666cac..0000000
--- a/roles/jails/22_forge/files/git-shell-commands/mirror-from
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-# mirror-from [REPO_NAME] [GIT_URL]
-# Configures a repo to pull updates from a remote git URL hourly.
-# Pass empty URL to remove the mirror source.
-# Example: mirror-from myrepo https://github.com/user/myrepo.git
-if [ -z "$1" ]; then
- echo "Usage: mirror-from [REPO_NAME] [GIT_URL]"
- echo " mirror-from [REPO_NAME] - remove mirror source"
- exit 1
-fi
-if [ ! -d "$1.git" ]; then
- echo "Repository $1 does not exist"
- exit 1
-fi
-
-REPO="$1"
-REMOTE="$2"
-REPO_PATH="$HOME/$REPO.git"
-
-cd "$REPO_PATH" || exit 1
-
-if [ -z "$REMOTE" ]; then
- if git remote get-url mirror-from >/dev/null 2>&1; then
- git remote remove mirror-from
- echo "Removed mirror source for $REPO"
- else
- echo "No mirror source configured for $REPO"
- fi
- exit 0
-fi
-
-if git remote get-url mirror-to >/dev/null 2>&1; then
- echo "Error: $REPO already has a mirror-to configured. Remove it first with: mirror-to $REPO"
- exit 1
-fi
-
-if git remote get-url mirror-from >/dev/null 2>&1; then
- git remote set-url mirror-from "$REMOTE"
-else
- git remote add mirror-from "$REMOTE"
-fi
-
-echo "Configured $REPO to mirror from $REMOTE"
-echo "Mirrors run hourly. Logs: /var/log/git-mirrors.log"