1

Is that possible to have all repositories on some local server and also browse it with Gitlab (hosted on other local server)?

I use Gitlab v8.3.3. and I have a following situation:
- I have all of my repositories stored at local server, say: 192.168.5.5 at /git
- I also have a local virtual machine that hosts Gitlab, at: 192.168.5.6
- I mounted my local git server at git-data directory (that's where repositories are being kept) by running:
sshfs my.user@192.168.5.5:/git /var/opt/gitlab/git-data/repositories/server-group

server-group is an empty directory created by Gitlab when I created a new group with the same name.

Now I would like to be able to browse repositories mounted this way via Gitlab.
Is that possible?

I believe it should be but it needs some extra configuration?
Of course simple: gitlab-ctl reconfigure or gitlab-ctl restart doesn't help and Gitlab group server-group has 0 projects even though in it's directory I have valid "repos.git".

lewiatan
  • 986
  • 1
  • 20
  • 35

2 Answers2

1

You need to create the projects in GitLab before they will show up.

But there are a couple considerations, GitLab is expecting the repos to be bare repos, and also will be expected a HEAD file to be set.

My advice would be to create the projects by importing each repo from your git server. This will create the bare repos with all your commits and branches, and create the projects in the GitLab database. Then if you still want the repos on a seperate server, you can move the GitLab created folders to the other server, and then mount them as you were trying.

Alternatively, if you still want to try to get your current repos to show up, and hope they work. (Not sure if they will if they aren't bare repos) You can try:

  • unmounting your git repo that you have setup
  • Creating empty projects for each of your repos, in a way that their path will match your current repos.
  • remount your git repos into the place where the empty repos where created.
twk3
  • 1,730
  • 10
  • 7
1

I resolved this issue by:
1. creating empty repositories with the same name using GitLab API

curl -k --header "PRIVATE-TOKEN: <your_private_token>" -H "Content-Type: application/json" -d '{"name":"<name_here>","path":"<the_same_name_here>","visibility_level":"10","namespace_id":"<id_of_my_group>"}' "https://192.168.5.6/api/v3/projects"


2. mounting our repositories as described in How can I use GitLab on one server and store all of the repositories on another? (including changing permissions - see answer)

Community
  • 1
  • 1
lewiatan
  • 986
  • 1
  • 20
  • 35