#4212 Create a script to do a daily sync of the infra mirror on github into fedorahosted
Closed: Fixed None Opened 7 years ago by pingou.

We currently have a number of projects on github.com/fedora-infra
It would be nice to have a script doing a daily mirror of the repos into our infrastructure (ie: hosted in this case).

It would probably be using the mirror setting from git and do a git pull on a daily basis.

That should be an easy task for someone interested in helping.

Hi, I would like to help with this. Can I have some more details regarding the fix?

Ok so we've the idea to make this a little bit bigger, some along the line of what pep8.me provides but this will require a little more work.

For now, what we could do is a simple script meant to be ran in a cron job on a daily or bi-daily basis just pull the changes from all the repos hosted in the fedora-infra group on github.

What the script would have to do is pretty much:
- gather the list of repos in the fedora-infra group
- if the repo exists: update
- otherwise: clone

The patch contains the entire code for syncing the repositories with github.

Edits: use REPO_BASE_DIR in small case, and use path.exists to determine existence of the repo

Used argparse for showing help, changed default repo_base_dir to /srv/git/ with an option to override, added .git extension to repo_name and added option to enable logging, which is disabled by default

We spoke about this at the meeting tonight.

We all like the idea and this is something to pursue. We do think we should base ourselves on the existing bare repo. A solution might be to base ourselves on https://github.com/mricon/grokmirror which already does a part of what we want.

Looks like the bigger project might come to life a little sooner than I originally thought: https://lists.fedoraproject.org/pipermail/infrastructure/2014-February/014127.html :)

Of course everyone is welcome to join :)

Moving all currently open easyfix tickets to the HANDYWAVY-FUTURE milestone.

I'm clearing the assigned status on all easyfix tickets.

If you are an apprentice actively working on this ticket, feel free to reassign to yourself. Otherwise let a new apprentice have a look.

I want to see the script code in order to see if i can help. I did login to hosted03.fedorahosted.org, but i didn't find the file "fedora_infra_sync.py". Please help me find the code.

Ok now that we have https://apps.fedoraproject.org/github2fedmsg/ deployed this ticket per say can be closed.

What we need now is the script: if a fedmsg commit message is sent on the bug for project X, update project X in fedorahosted. But that is a different ticket.

Login to comment on this ticket.