Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to add mirrors via a mirror_list file #62

Open
logicminds opened this issue Jan 8, 2015 · 9 comments
Open

ability to add mirrors via a mirror_list file #62

logicminds opened this issue Jan 8, 2015 · 9 comments

Comments

@logicminds
Copy link
Contributor

This is just to open up some dialog around adding a feature that I have implemented elsewhere and was considering contributing it to this repo.

Basically I created a ruby script that takes in a yaml file with a list of repo names and origin locations. This script will utilize the config.sh variables to figure out where the scripts and other configurations lie.

Example Mirror list file

---
puppet-staging: https://github.com/nanliu/puppet-staging.git

The script loops around the mirror list and adds them via the add_mirrors.sh script. Setting up a cron job allows one to automatically add new mirrors by just updating the mirror_list.yaml. Furthermore, if you keep the mirror list in a git repo and create a cron job to auto update the mirror_list repo you can basically control the whole mirroring via a new commit to the mirror list repo.

https://github.com/logicminds/gitlab_mirrors/blob/master/files/sync_mirrors.rb

If you think this is a nice feature and want to have it as part of the code base I can clean it up and issue a PR.

Additionally, I have created a basic puppet module for configuring everything mentioned above and the gitlab_mirrors configuration item specified in your README.md.

https://github.com/logicminds/gitlab_mirrors (I should rename this so it doesn't conflict, documentation coming soon)

@samrocketman
Copy link
Owner

That's a pretty good idea; however I notice you checked in the yaml file. I would rather see a mirror_list.yml.SAMPLE file similar how there's a config.sh.SAMPLE based on gleaning from your repository. Your puppet version is awesome 💃

@samrocketman
Copy link
Owner

Also, I'm adding your puppet module to the README :D

@logicminds
Copy link
Contributor Author

I actually thought about a few enhancements too. Maybe you know of the top of your head.
Given the api key we should be able to post the generated ssh key to the user profile via a curl command so the user has one less thing to do.

I'll be adding and properly releasing the module to the forge sometime next week once I get some more testing on a real system.

@samrocketman
Copy link
Owner

I could add a script to gitlab-mirrors if you like that would essentially be: upload_sshkey.sh which would talk to the GitLab API and upload ~/.ssh/id_rsa.pub to the account given the API token from config.sh. This would make bootstrapping even easier.

@logicminds
Copy link
Contributor Author

+1

@samrocketman
Copy link
Owner

Also, I've been thinking about rewriting the entire code base into ruby. This would give my code the benefit of unit testing and less fear of accepting contributions because I look long and hard at code contributions; lots of manual testing code as well. But that would come after adding that ssh script. I feel like coding. Also, it's my birthday :D I was out until 2:30am last night so this is a good relaxing zen evening for me.

@samrocketman
Copy link
Owner

I'll be hanging out in #gitlab on freenode.

@samrocketman
Copy link
Owner

This is a feature that would be useful. Effort for this would be best put towards the ruby rewrite. ref link #63.

@samrocketman samrocketman reopened this Feb 3, 2015
@samrocketman samrocketman modified the milestone: gitlab-mirrors 0.6 Feb 3, 2015
@samrocketman samrocketman removed this from the gitlab-mirrors 0.6 milestone Mar 25, 2015
@samrocketman
Copy link
Owner

Since ruby rewrite probably won't happen this should be considered for implementation in this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants