diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-05-07 12:54:35 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-05-07 12:54:35 +0100 |
| commit | 599b73a83cf1b0f648159dbb250ab880732856a4 (patch) | |
| tree | fc15b807e272a631d24dd0e531e289756bb0f489 | |
| parent | ebd65b62f4f314e7c1a6fe1c847fc2cec52e4f15 (diff) | |
| download | git.zue.dev-599b73a83cf1b0f648159dbb250ab880732856a4.tar git.zue.dev-599b73a83cf1b0f648159dbb250ab880732856a4.tar.gz git.zue.dev-599b73a83cf1b0f648159dbb250ab880732856a4.tar.bz2 git.zue.dev-599b73a83cf1b0f648159dbb250ab880732856a4.tar.xz git.zue.dev-599b73a83cf1b0f648159dbb250ab880732856a4.zip | |
Remove obsolete mirror script and add gitinfo script for repository descriptions
| -rw-r--r-- | etc/cron.d/10m | 1 | ||||
| -rw-r--r-- | etc/cron.d/1m | 1 | ||||
| -rw-r--r-- | scripts/gitinfo.bash | 18 | ||||
| -rw-r--r-- | scripts/mirrors.bash | 5 |
4 files changed, 19 insertions, 6 deletions
diff --git a/etc/cron.d/10m b/etc/cron.d/10m deleted file mode 100644 index 56b6070..0000000 --- a/etc/cron.d/10m +++ /dev/null @@ -1 +0,0 @@ -* * * * * /bin/bash /scripts/mirrors.bash >> /var/log/mirrors.log 2>&1
\ No newline at end of file diff --git a/etc/cron.d/1m b/etc/cron.d/1m new file mode 100644 index 0000000..1dd9b9d --- /dev/null +++ b/etc/cron.d/1m @@ -0,0 +1 @@ +* * * * * /bin/bash /scripts/gitinfo.bash >> /var/log/gitinfo.log 2>&1
\ No newline at end of file diff --git a/scripts/gitinfo.bash b/scripts/gitinfo.bash new file mode 100644 index 0000000..e4b089f --- /dev/null +++ b/scripts/gitinfo.bash @@ -0,0 +1,18 @@ +#/bin/bash + +for repository in /repositories/*; do + cd /repositories/$(basename "$repository") + gitinfo=$(git cat-file -p @:.gitinfo) + + # does gitinfo exist? expect "fatal" if not + if [[ $gitinfo == fatal* ]]; then + echo "No .gitinfo found for $(basename "$repository")" + continue + fi + + # extract description from gitinfo (json format) + description=$(echo "$gitinfo" | grep -oP '"description":\s*"\K[^"]+') + + # write description to repository description file + echo "$description" > /repositories/$(basename "$repository")/description +done
\ No newline at end of file diff --git a/scripts/mirrors.bash b/scripts/mirrors.bash deleted file mode 100644 index 02c333f..0000000 --- a/scripts/mirrors.bash +++ /dev/null @@ -1,5 +0,0 @@ -#/bin/bash - -# This script is responsible for pushing to mirrors of the git repositories. It runs through all the repositories in the /repositories directory and performs a git push to the corresponding mirror URL(s) defined in the .gitinfo file if they exist. - -echo "to be implemented"
\ No newline at end of file |
