D
D
Dmitry Vapelnik2013-11-30 20:25:20
Redmine
Dmitry Vapelnik, 2013-11-30 20:25:20

redmine_gitolite plugin / Redmine + Gitolite

Installed on a server running CentOS 6.4 x32, Redmine

# ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [i686-linux]
# gem list | egrep '^rails'
rails (4.0.1, 3.2.15)

Redmine is running under the unix user redmine
also installed gitolite from the repository using yum. it runs under the unix user gitolite. The redmine user has access to the gitolite-admin repository. dealt with the keys - everything is in order
[redmine hooks]$ ssh [email protected] info
hello redmine, this is gitolite 2.3.1-1.el6 running on git 1.7.1
the gitolite config gives you the following access:
     R   W      gitolite-admin
     R   W      project-repo
    @R_ @W_     testing

I created a project in Redmine. specified in the plugin settings [redmineRoot]/plugins/redmine_gitolite/init.rb:
settings :default => {
  'gitoliteUrl' => '[email protected]:gitolite-admin.git',
  'developerBaseUrls' => "[email protected]:%{name}.git",
  'readOnlyBaseUrls' => 'http://git.my.own.domain.com/%{name}.git',
  'basePath' => '/home/redmine/repositories/',
}.

Made read-only access to the repositories via http
in the project settings added a repository
, the repository was displayed for me only after I cloned (git clone --bare ... ) it to the specified folder (/home/redmine/repositories/) after
reading the documentation according to the redmine_gitolite plugin, I guess that you can configure git hooks so that when pushing to the repository, it updates the repository that is used in Redmine for display.
in the [redmineRoot]/plugins/redmine_gitolite/contrib/hooks folder, I found two hook examples. As far as I understand, the usual example and simplified.
[hooks]$ ls -l
total 8
-rw-rw-r-- 1 redmine redmine 1684 Nov 28 15:48 post-receive-redmine_gitolite
-rw-rw-r-- 1 redmine redmine  903 Nov 28 12:15 post-receive-redmine_gitolite.simple

if I'm not mistaken, then I correctly registered the values ​​​​of the variables (I do not give the code of the entire hook)
[...]
REDMINE_SERVER=http://redmine.my.own.doamin.com
HOOK_URL=gitolite_hook
FETCH_URL=sys/fetch_changesets
KEY=my.own.salt.from.Redmine.administration.part
LOG=/var/lib/gitolite/logs/post-receive.log
[...]

I put the file /home/gitolite/.gitolite/hooks/common/post-receive.redmine_gitolite, gave it the right to execute (chmpd +x) and did gl-setup to update the links in the folders of all repositories
, as far as I understand, then when A push to the repository should trigger this hook and send a cURL request to Redmine to access the repository via gitolite and update it (the repository) in its /home/redmine/repositories/ folder.
redmine unix user has RW+ access to the project repository
after pushing I will look at httpd access log but there is no cURL request to Redmine
Maybe I don't understand something or do something wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question