「SCM Creator」はRedmineのプラグインになります。
これを導入すればRedmineの画面上からGitやSubversion等のリポジトリを作成することができます。
今回は導入手順を紹介します。
まずは必要なミドルウェアをインストールします。
$ yum install subversion mod_dav_svn git $ yum install mod_perl perl-DBI perl-Digest-SHA perl-DBD-MySQL
git用のリポジトリを作成します。
$ mkdir -p /var/www/repos/git $ chown -R apache:apache /var/www/repos
SCMCreatorをダウンロードします。
下記のサイトでSCMCreatorの最新バージョンが確認できます。
http://projects.andriylesyuk.com/projects/scm-creator
$ wget http://projects.andriylesyuk.com/attachments/download/563/redmine_scm-0.5.0b.tar.bz2
ダウンロードしてきたファイルを回答しプラグインとして配置します。
$ tar xvjf redmine_scm-0.5.0b.tar.bz2 $ sudo mv redmine_scm /var/lib/redmine/plugins/redmine_scm $ sudo chown -R apache:apache /var/lib/redmine/plugins/redmine_scm
Redmineのデータベースをプラグインに合わせてマイグレーションします。
このときRubyやRailsのバージョンによってはエラーが発生する場合があります。
対処法は先日の記事に記述しております()。
$ rake redmine:plugins:migrate RAILS_ENV=production
プラグインの設定ファイルを書き換えます。
mercurialやbazaarも使用する予定がなくても追加しておきます。
$ vi /var/lib/redmine/config/scm.yml
production: deny_delete: true auto_create: false allow_add_local: true svn: path: /var/www/repos/svn svnadmin: /usr/bin/svnadmin url: repos/svn git: path: /var/www/repos/git git: /usr/bin/git options: --bare url: repos/git update_server_info: true git_ext: true mercurial: path: /var/lib/mercurial hg: /usr/bin/hg bazaar: path: /var/lib/bazaar bzr: /usr/bin/bzr init: init-repository log_encoding: UTF-8 development:
RedmineのApacheの設定を書き換えます。
$ vi /etc/httpd/conf.d/redmine.conf
ファイルの下に次のような記述を追加します。
PerlLoadModule Apache::Authn::Redmine # Subversion <Location /repos/svn> DAV svn SVNParentPath "/var/www/repos/svn" AuthType Basic AuthName "Redmine SVN Repository" Require valid-user PerlAccessHandler Apache::Authn::Redmine::access_handler PerlAuthenHandler Apache::Authn::Redmine::authen_handler RedmineDSN "DBI:mysql:database=redmine_db;host=localhost" RedmineDbUser "redmine" RedmineDbPass "redmine" </Location> # Git SetEnv GIT_PROJECT_ROOT /var/www/repos/git SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /repos/git/ /usr/libexec/git-core/git-http-backend/ <Location /repos/git> AuthType Basic AuthName "Redmine Git Repository" Require valid-user PerlAccessHandler Apache::Authn::Redmine::access_handler PerlAuthenHandler Apache::Authn::Redmine::authen_handler RedmineDSN "DBI:mysql:database=redmine_db;host=localhost" RedmineDbUser "redmine" RedmineDbPass "redmine" RedmineGitSmartHttp yes </Location>
最後にApacheを再起動します。
$ /etc/init.d/httpd restart
管理画面にリポジトリが表示されるようになります。
ここからGitやSubversionのリポジトリが作成できます。