Skip to content
Snippets Groups Projects
Commit dcb29464 authored by Sam Gleske's avatar Sam Gleske
Browse files

Merge branch 'development' release v0.4.7

parents 1d532719 011c4568
No related branches found
No related tags found
No related merge requests found
## v0.4.6
## gitlab-mirrors v0.4.7
* Update installation docs to clarify gitlab-mirrors installation process.
---
## gitlab-mirrors v0.4.6
* Fix bug where all scripts break without a meaningful message if config.sh is not present.
--
## v0.4.5
---
## gitlab-mirrors v0.4.5
* Updated docs for Mercurial mirror management.
---
## v0.4.4
## gitlab-mirrors v0.4.4
* Added Mercurial mirroring support. `add_mirror.sh` now has the `--hg` option when adding a repository.
---
## v0.4.3
## gitlab-mirrors v0.4.3
* Added `no_create_set` option to `config.sh`. This option forces the user to always provide a remote for pushing repositories via the `--no-create` option in `add_mirror.sh`.
---
## v0.4.2
## gitlab-mirrors v0.4.2
* Added `--no-create` option to `add_mirror.sh` which gives the script the remote to push manually rather than attempting any communication with GitLab. This enables gitlab-mirrors to be used with non-gitlab git remotes. It was specifically integrated for the purpose of mirroring gitlab wikis.
* Added `--no-delete` option to `delete_mirror.sh` which only deletes the local copy of the mirror and does not attempt communication with GitLab. This is the delete equivalent of `--no-create`.
---
## v0.4.1
## gitlab-mirrors v0.4.1
* Added upgrade docs for upgrading v0.3 to v0.4
......
......@@ -62,4 +62,4 @@ Created by Sam Gleske under [MIT License](LICENSE).
* Docs #1 [lmakarov](https://github.com/lmakarov)
* Bzr support #6 [Agustín Cruz Lozano](https://github.com/agb80) (atin81@gmail.com)
* SVN update tags #13 [Nikolaus Krismer](https://github.com/nikolauskrismer)
* Docs #26 [Glen Mailer](https://github.com/glenjamin)
......@@ -6,9 +6,21 @@ Things to note before beginning:
* GitLab will not allow users (even admins) to add a project to a group unless that user is designated an `owner` of the group. This is by design in GitLab.
* `gitlab-mirrors` will not auto-create a group (though it will auto-create projects within a group). This is by design in `gitlab-mirrors`. One should create the group manually and assign the `gitmirror` user as an owner of the group. This is to ensure mirroring a repository for a particular group is a purposeful action.
* `gitlab-mirrors` **must not** be shared by the same user as GitLab which is typically the `git` user. It will not work and you'll run into a lot of configuration trouble.
## Using a dedicated GitLab user
### Overview
* Create `gitmirror` system user.
* Create `gitmirror` GitLab Administrator user.
* Create a `Mirrors` group in GitLab owned by `gitmirror` (or name it whatever you want).
* Clone gitlab-mirrors repository in `gitmirror` system user.
* Modify `config.sh` using the user token from `gitmirror` GitLab user.
* Create a cron job to update mirrors regularly.
### Create gitmirror system user
Create a system user called `gitmirror` and generate SSH keys.
adduser gitmirror
......@@ -20,9 +32,15 @@ Create `~/.ssh/config` for the `gitmirror` user. Add your GitLab server host an
Host gitlab.example.com
User git
Create a gitmirror user in gitlab. Set up the SSH keys with the gitmirror user in GitLab. Obtain the Private token from the user.
### Create gitmirror GitLab user
Create a `gitmirror` user in GitLab and set the user to be a GitLab administrator.
Set up the SSH keys with the gitmirror user in GitLab.
Obtain the Private token from the user.
Create "Mirrors" group in gitlab and designate gitmirror user as the Owner of the group. Realistically the group does not have to be called `Mirrors`. It could be anything and in fact multiple mirror groups can be mirrored within the same repository folder.
### Create Mirrors group in GitLab
Create "Mirrors" group in GitLab and designate `gitmirror` GitLab user as the Owner of the group. Realistically the group does not have to be called `Mirrors`. It could be anything and in fact multiple mirror groups can be mirrored within the same repository folder.
Clone the gitlab-mirrors repository and set values in config.sh.
......@@ -34,27 +52,30 @@ Clone the gitlab-mirrors repository and set values in config.sh.
chmod 755 *.sh
cp config.sh.SAMPLE config.sh
Modify the values in `config.sh` for your setup. Be sure to add your private token for the gitmirror user in gitlab to `~/private_token` of your `gitmirror` system user.
### Modify config.sh
Modify the values in `config.sh` for your setup.
Write the private token of the gitmirror GitLab user into `~/private_token` of your `gitmirror` system user.
### Schedule cron job
Once you have set up your `config.sh` let's add the `git-mirrors.sh` script to `crontab`. Just execute `crontab -e` and add the following value to it.
@hourly /home/gitmirror/gitlab-mirrors/git-mirrors.sh
### Mirror to multiple GitLab groups
Here's an example of a file tree where I have multiple groups specified with a different gitlab-mirrors project governing each.
```
/home/gitmirror/
├── mirror-management
│ ├── GitLab
│ │ └── gitlab-mirrors
│ ├── Mirrors
│ │ ├── authors_files
│ │ ├── gitlab-mirrors
│ └── Subscribers
│ └── gitlab-mirrors
└── repositories
├── GitLab
│ └── gitlab-mirrors
├── Mirrors
│ ├── git
│ ├── gitlabhq
......
VERSION="v0.4.6"
VERSION="v0.4.7"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment