From Fedora Project Wiki

< Infrastructure

Revision as of 22:43, 19 March 2018 by Kevin (talk | contribs) (initial grokmirror page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

grokmirror for Fedora git repository content

[ https://github.com/mricon/grokmirror grokmirror ] is a open source framework for mirroring git repositories.

Fedora Infrastucture has setup a grokmirror manifest and hooks for all git repositories on [ https://src.fedoraproject.org src.fedoraproject.org ] This includes all the Fedora packages, forks of those packages, pull requests and so on. Users are welcome to mirror as much or as little of this content as they wish. Note that grokmirror is vastly more efficient than just doing 'git pull' in all repos without knowing if they updated or not, and keeps you much closer to up to date than a weekly checkout seed, so users wanting this content are encouraged to use grokmirror for it.

Client setup

  • Install python2-grokmirror (available in Fedora / EPEL)
  • copy the sample repos.conf from /usr/share/doc/python2-grokmirror/repos.conf and modify to suit your local needs.
  • Use the following config options in repos.conf:

site = https://src.fedoraproject.org manifest = https://src.fedoraproject.org/grokmirror/manifest.js.gz

  • include and/or exclude any projects you wish

Post pull hook

grokmirror operates on 'bare' git repos. If you wish to update a set of non bare ones to push changes to, you can set a post_update_hook to something like:

`sh

  1. !/bin/sh -efu
  1. echo "$@" >&2
  2. echo "$@" >> ~/upd

repo="$1"

repo_local="${repo#/home/brain/mirror/}" repo_local="${repo_local%.git}"

  1. echo "$repo_local" >&2

if [ -d "$repo_local" ]; then

 git -C "$repo_local" pull

else

 git clone -s "$repo" "$repo_local"

fi `

Future plans

Now that src.fedoraproject.org is up and using grokmirror, we would like to add it also to our other large collections of git repos: [ https://pagure.io pagure.io] and copr dist-git. These collections will be added as time permits.

Links

https://github.com/mricon/grokmirror