Fork of http://projects.andriylesyuk.com/projects/scm-creator.
The following explanation is adapted from a Origin of fork.
Simple Subversion, Git, Mercurial,Bazaar and Github repository creation plugin for Redmine. With this plugin repository creation and registration becomes very easy and needs just one click (or even no click).
This repository is different from the original repository forked in the following point.
- Change for use with Redmine 3.4
- Bug fixese
This plugin requires Redmine version 3.4 or lower.
The plugin adds “Create new repository” button to the repository addition form (Project → Settings → Repository → Subversion/Git/Mercurial/Bazaar/Github).
With just one click on this button a user can create local repository and register it in Redmine.
The plugin also allows to create repository automatically on project registration.
Github SCM is another SCM type, that comes with SCM Creator (not available in pure Redmine).
The plugin adds “Create new repository” button to the Subversion,Git, Mercurial, Bazaar and Github repository creation form (“Repository” tab in project settings):
The plugin will automatically fill in the repository URL field with the root directory1 and project identifier.
To create new local2 repository you just need to click the “Create new repository” button.It is also possible to configure the plugin to create repositories automatically for new projects.
! If you are using Redmine based authentication for repositories access (what is recommended) the repository name3 must be identical to the project identifier.
The plugin will create the repository for you and automatically register it in Redmine(no need to additionally click on the “Create” button below the form).
Assuming you already have installed Subversion, Git, Mercurial and/or Bazaar and the Apache DAV module. Please refer to your operating system manual on how to do this if not.
First you need to choose where repositories are going to be stored and to create this directory. For example, for SVN I chose /var/lib/svn.
# mkdir /var/lib/svn
This directory should be writtable by the user Redmine is ran from (this can be www-data, apache or nobody - depending on the OS4).
Change the owner and the group:
# chown www-data:www-data /var/lib/svn
If you are not sure about the owner try running the following command:
# ps aux | grep ruby
www-data 32262 4.3 12.1 262304 127864 ? S 14:39 15:55 ruby
/usr/share/redmine/public/dispatch.fcgi
Also make sure the directory can be written by the user:
# ls -l /var/lib | grep svn
drwxr-xr-x 18 www-data www-data 4096 May 17 12:44 svn
To change permissions do:
# chmod 0755 /var/lib/svn
Do the same for Git, Mercurial and/or Bazaar.
The plugin reads its configuration from #{RAILS_ROOT}/config/scm.yml. Copy sample scm.yml file from the plugin directory to #{RAILS_ROOT}/config/ and modify it.
The configuration of the plugin is described in details on the corresponding page. Check this page for common configuration scenarios.
You can configure the plugin to create a repository automatically when a project is registered.
For this change the auto_create option to true or force (for meanings of these values check this page).
When the automatic creation is enabled the project registration form will have an additional field:
To install the plugin do:
- Install plugin:
cd /path/to/redmine/plugins
git clone https://github.com/farend/scm-creator.git redmine_scm
cd /path/to/redmine
bundle install --without development test
rake redmine:plugins:migrate RAILS_ENV=production
-
Make sure the directory name of the plugin is 'redmine_scm'.
⚠️ The plugin does not work if the directory name is not 'redmine_scm'.
If the directory name is not 'redmine_scm', please fix it. -
Restart Redmine
It is recommended to configure your SVN/Git/Mercurial server to use usernames, passwords and permissions from the Redmine database.
Refer the following links on what to do next:
- For Subversion:
- For Git (it is slightly more complicated):
- For Mercurial (did not test it):
Note: For Redmine based SVN/Git/Mercurial authentication to work the repository name and the project identifier must be identical.
Copylight (C) 2017 FAR END Technologies Corporation Originally under GPL v2 in Andriy Lesyuk, http://subversion.andriylesyuk.com/scm-creator/
1 specified in scm.yml
2 in terms of Redmine server
3 last directory in repository URL
4 this page describes installation under Unix-like OSes only