Reputation: 1176
Recently I installed GitLab (v8.3.3) on my server and mounted my existing repositories with NFS in place of repositories created for my gitlab group.
I want to make GitLab to show all of my activity for current repo in GitLab Activity feed so I checked whether it's working or not (it is not).
I have noticed that my old repositories (not created by gitlab) have only hooks examples so I replaced them with GitLab hooks (post-receive, pre-receive and update).
Now when I clone repository with path provided by GitLab (i.e. [email protected]_company.com:group/repo_name.git
) and then push - the activity is visible via GitLab.
On the other hand when I clone via direct link to repo (i.e. ssh://<user_name>@192.168.12.34/path/to/repo_name.git
) - the activity does not show in Dashboard/Activity.
My question:
How to make GitLab to update Activity from both remote paths?
Does this have something to do with changing those hooks?
EDIT: I just noticed that my git repo is on one server and my GitLab is on another machine. Hooks directory is symlinked so on original git server hooks directory is a link pointing to nowhere.
Can I forward a "git push" from one machine to GitLab server?
Upvotes: 1
Views: 691
Reputation: 1903
Ideally you would only use your GitLab server from now on to manage the repos, as it will be managing users and their keys. While you could setup a post-receive hook on youre repo server that adds the redis job with the data (this is what triggers the activity, and is mostly all you are missing here) You won't be able to easily credit the right users without the same key-ids as the gitlab server. You could create a system user in GitLab that you always would credit pushes to your repos server with. But that is probably less than ideal.
Upvotes: 1
Reputation: 2970
I would say that you would have to install a script that you would point to from your authorized_keys file. It would have to examine the commands passed to it and run the same gitlab-shell as is run by the git user, in case it is a git command.
Normally your git commands over ssh will not run in the gitlab shell, but the standard git commands.
Upvotes: 1