From f47a2ded50f3367d0c7b0673a6c452a93c1a669f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Nov 2025 11:44:36 +0900 Subject: feat(repos): add new service, repos --- services/repos/scripts/clone-repos.sh | 16 ++++++++++++++++ services/repos/scripts/fetch-repos.sh | 12 ++++++++++++ services/repos/scripts/make-repo-list.sh | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 services/repos/scripts/clone-repos.sh create mode 100755 services/repos/scripts/fetch-repos.sh create mode 100755 services/repos/scripts/make-repo-list.sh (limited to 'services/repos/scripts') diff --git a/services/repos/scripts/clone-repos.sh b/services/repos/scripts/clone-repos.sh new file mode 100755 index 00000000..e4ea7ffc --- /dev/null +++ b/services/repos/scripts/clone-repos.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +for url in $(grep '^repo\.homepage=' repos.cgitrc | sed 's/^repo\.homepage=//'); do + repo_name=$(basename "$url" .git) + repo_path="repos/${repo_name}.git" + + if [[ -d "$repo_path" ]]; then + echo "Skipping $repo_name" + else + echo "Cloning $repo_name from $url" + git clone --bare "$url" "$repo_path" + sleep 5 + fi +done diff --git a/services/repos/scripts/fetch-repos.sh b/services/repos/scripts/fetch-repos.sh new file mode 100755 index 00000000..e8e9d4ea --- /dev/null +++ b/services/repos/scripts/fetch-repos.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -euo pipefail + +for repo_path in repos/*; do + if [[ -d "$repo_path" ]]; then + repo_name=$(basename "$repo_path" .git) + echo "Fetching $repo_name" + git -C "$repo_path" fetch --tags --prune origin + sleep 5 + fi +done diff --git a/services/repos/scripts/make-repo-list.sh b/services/repos/scripts/make-repo-list.sh new file mode 100755 index 00000000..73e7be68 --- /dev/null +++ b/services/repos/scripts/make-repo-list.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cat < /dev/null > repos.cgitrc +for repo in $(gh repo list --limit 999 --source --visibility public --json name --jq '.[].name'); do + cat >> repos.cgitrc <