diff options
Diffstat (limited to 'roles/git/files/runner-mirror/mirror.sh')
-rwxr-xr-x | roles/git/files/runner-mirror/mirror.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/roles/git/files/runner-mirror/mirror.sh b/roles/git/files/runner-mirror/mirror.sh index 0aade9d..9a3c04b 100755 --- a/roles/git/files/runner-mirror/mirror.sh +++ b/roles/git/files/runner-mirror/mirror.sh @@ -1,5 +1,12 @@ #!/bin/sh +# Access git server through podman network if available. +if ping -c 1 cgito &> /dev/null; then + HOST=cgito +else + HOST=git.memzero.de +fi + function mirror() { local repo=$1 @@ -9,7 +16,7 @@ function mirror() { git -C $repo fetch --all --prune fi - git -C $repo push --mirror ssh://git.memzero.de/mirror/$repo + git -C $repo push --mirror ssh://$HOST/mirror/$repo } function lock() { |