Updated readme

master
Facinorous 4 years ago
parent 42496fcbba
commit 46521b3293

@ -1,12 +1,43 @@
Yes, I know this README sucks.
This isn't the final version. This is just to give you a basic understanding of how easy it will be to run this shit.
== SET UP ==
1. Create a user in your gitlab named <code>gitmirror</code> 1. Create a user in your gitlab named <code>gitmirror</code>
2. Create a new user on your linux system. 2. Create a new user on your linux system, probably best to name it <code>gitmirror</code> too
3. Clone this repo into your new users home directory <code>~</code> 3. Clone this repo into your new users home directory <code>~</code>
4. Edit setup.conf to your desires 4. Edit setup.conf to your desires
5. Run <code>./setup</code> to behin the set up process 5. Run <code>./setup</code> to begin the set up process
6. Copy ssh key shown in terminal at the end of setup script into your gitlab users account 6. Copy ssh key shown in terminal at the end of setup script into your gitlab users account
7. Run <code>./creategroups</code> to make all the groups in gitlab 7. Run <code>./creategroups</code> to make all the groups in gitlab <-- this is a WIP script, for now you must make your own in gitlab under the user you made before
8. Run <code>./mirror</code> to set up a mirror 8. Run <code>./setcron</code> to add the mirror cron jobs to the users cron table
== ADDING MIRRORS ==
Run <code>./mirror</code> to set up a mirror
If you at any time want to add more groups you can mirror to, simply add them to the setup.conf file and rdo the set up process again.
== UPDATING DEPENDANCIES ==
Use <code>./update</code> to update your gitlab-mirror dependancy
Write script to create cron jobs for auto mirrors == FILE STRUCTURE ==
Use ./update to update your gitlab-mirror dependancy ```
/home/gitmirror/gitmirrors-bs
├── mirrormanagement
│ ├── Group1
│ │
│ └── Group2
└── repositories
├── Group1
│ ├── git
│ ├── gitlabhq
│ ├── gitlab-shell
│ ├── nsca-ng
│ ├── python-gitlab
│ ├── ruby
│ └── systems-svn
└── Group2
└── GitLab Enterprise Edition
```

@ -24,9 +24,7 @@ except KeyError:
print >> stderr, "Environment config missing. Do not run this script standalone." print >> stderr, "Environment config missing. Do not run this script standalone."
exit(1) exit(1)
parser = OptionParser() parser = OptionParser()
#NEW CODE
parser.add_option("--creategroup",dest="creategroup",action="store_true",default=False) parser.add_option("--creategroup",dest="creategroup",action="store_true",default=False)
#END OF NEW CODE
parser.add_option("--issues",dest="issues",action="store_true",default=False) parser.add_option("--issues",dest="issues",action="store_true",default=False)
parser.add_option("--wall",dest="wall",action="store_true",default=False) parser.add_option("--wall",dest="wall",action="store_true",default=False)
parser.add_option("--merge",dest="merge",action="store_true",default=False) parser.add_option("--merge",dest="merge",action="store_true",default=False)
@ -129,7 +127,6 @@ def needs_transfer(user, groupname, project):
else: else:
return project.namespace['name'] != namespace return project.namespace['name'] != namespace
#NEW CODE
if options.creategroup: if options.creategroup:
found_group = find_group(name=gitlab_namespace) found_group = find_group(name=gitlab_namespace)
@ -139,7 +136,6 @@ if options.creategroup:
else: else:
create_group=gl.groups.create({'name': f"{gitlab_namespace}", 'path': f"{gitlab_namespace}"}) create_group=gl.groups.create({'name': f"{gitlab_namespace}", 'path': f"{gitlab_namespace}"})
#END OF NEWCODD
if options.create: if options.create:
found_group = find_group(name=gitlab_namespace) found_group = find_group(name=gitlab_namespace)

Loading…
Cancel
Save