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

Merge branch 'release' v0.2.10

parents 08960acc c45a1be0
Branches
Tags
No related merge requests found
## gitlab-mirrors v0.2.10
* This is a bugfix release in the gitlab-6-0 branch series. From now on all v0.2.X releases will be for the `gitlab-6-0` branch and all v0.3.X releases will be for the `gitlab-6-1` branch.
* Fixed bug where cron job for `update-mirror.sh` would fail if GitLab was offline and leave SVN mirrors in an unusable bare state.
* Updating installation docs adding note about `Mirrors` group creation step in gitlab, thanks @lmakarov.
---
## gitlab-mirrors v0.2.9
* `git-mirrors.sh` major bugfix where working directory was not properly set before executing mirror updates. This caused the `cron` job to fail.
......
......@@ -17,6 +17,8 @@ Create `~/.ssh/config` for the `gitmirror` user. Add your GitLab server host an
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 "Mirrors" group in gitlab and designate gitmirror user as the Owner of the group.
Clone the gitlab-mirrors repository and set values in config.sh.
su - gitmirrors
......
VERSION="v0.2.9"
VERSION="v0.2.10"
......@@ -56,11 +56,13 @@ def findgroup(gname):
print >> stderr, "gitlab-mirrors will not automatically create the project namespace."
exit(1)
def findproject(gname,pname):
def findproject(gname,pname,user=False):
page=1
while len(git.getProjects(page=page)) > 0:
for project in git.getProjects(page=page):
if project['namespace']['name'] == gname and project['name'] == pname:
if not user and project['namespace']['name'] == gname and project['name'] == pname:
return project
elif user and project['namespace']['path'] == gname and project['name'] == pname:
return project
page += 1
else:
......@@ -76,7 +78,7 @@ def createproject(pname):
description=options.desc
new_project=git.createProject(pname,description=description,issues_enabled=str(int(options.issues)),wall_enabled=str(int(options.wall)),merge_requests_enabled=str(int(options.merge)),wiki_enabled=str(int(options.wiki)),snippets_enabled=str(int(options.snippets)),public=str(int(options.public)))
if gitlab_user != gitlab_namespace:
new_project=findproject(gitlab_user,pname)
new_project=findproject(gitlab_user,pname,user=True)
new_project=git.moveProject(found_group['id'],new_project['id'])
if findproject(gitlab_namespace,pname):
return findproject(gitlab_namespace,pname)
......
......@@ -37,7 +37,13 @@ if git config --get svn-remote.svn.url &> /dev/null;then
git svn rebase
cd .git
git config --bool core.bare true
git push gitlab
#bug fix for when gitlab is off-line during a cron job the bare setting gets set back to false when the git command fails
set +e
if ! git push gitlab;then
git config --bool core.bare false
exit 1
fi
set -e
git config --bool core.bare false
else
#just a git mirror so mirror it accordingly
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment