CentOS 6.2 ã« GitLab ãã¤ã³ã¹ãã¼ã«ãã
å°ãåã« GitHub ã¯ãã¼ã³ã§ãã GitLab ãæ¤è¨¼ãã¦ããéã®ç°å¢æ§ç¯ã¡ã¢ãæ´çãã¦ãã¾ã¨ãã¦ã¿ã¾ããã
GITLAB
http://gitlabhq.com/
ç¾å¨å ¬å¼ãªãã¸ããªã§ã¯ 2.3.1 ãææ°ã®ããã§ããã試ããæã®ãã¼ã¸ã§ã³ãªã®ã§ 2.2.0 ã§ã®è¨äºã«ãªã£ã¦ãã¾ãã
2013.08.16 追è¨
æ°ãããã¼ã¸ã§ã³ã«ã¤ãã¦è¨äºãæ¸ãã¦ãã¾ãã
ãã¡ããåç
§ãã¦ãã ããã
GitLab 5.4.0 を CentOS 6.4 にインストールする
ç°å¢
使ç¨ããåã½ããã¦ã§ã¢ã®ãã¼ã¸ã§ã³ã¯ä»¥ä¸ã«ãªãã¾ãã
CentOS | 6.2(i686) |
---|---|
Git | 1.7.1 |
Ruby | ruby 1.9.3p125 |
gitolite | ææ° |
GitLab | 2.2.0 |
gitoliteãGitLab 以å¤ã«ã¤ãã¦ã¯æ¢ã«å°å
¥æ¸ã¿ã¨ããããã§ã¯è§£èª¬ãçãã¾ãã
ã¾ããYum ãªãã¸ããªã¨ãã¦ã¯ EPEL ã追å æ¸ã¿ã®ãµã¼ãã§ä½æ¥ãã¦ãã¾ããã
ä»ã«ãããã¤ãã®ã©ã¤ãã©ãªãªã©ã¯ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ã¨ããããæ§ç¯ãã¹ã¿ã¼ããã¦ãããããéä¸ã¨ã©ã¼ã«ãªãããã§ããã°é©å®å°å
¥ãã¦ãã ãã ^^;
ã¦ã¼ã¶ã®ä½æã¨å ¬ééµã®æºå
gitolite 管çç¨ã¦ã¼ã¶ git 㨠gitlab å®è¡ç¨ã¦ã¼ã¶ gitlabhq ã¦ã¼ã¶ãä½æãã¾ãã
ã¾ããgitlabhq ã¦ã¼ã¶ã git ã°ã«ã¼ãã«ãæå±ããã¦ããã¾ãã
# useradd git # useradd gitlabhq # usermod -G git gitlabhq
ã°ã«ã¼ãã«æå±ããã¦ã¼ã¶ãããªãã¸ããªãåç §ã§ããããã«ã/home/git ã«ã°ã«ã¼ãã«å¯¾ãããã¼ããã·ã§ã³ãè¨å®ãã¾ãã
# chmod g+rx /home/git
gitolite ã¸ç»é²ããããã®ç®¡çã¦ã¼ã¶ç¨å ¬ééµãä½æãããã gitlabhq ã¦ã¼ã¶ã«ãªãã¾ãã
# su - gitlabhq
ä¸æ¦ localhost ã« ssh æ¥ç¶ã試ã¿ã/home/gitlabhq/.ssh/known_hosts ãä½æãã localhost ãç»é²ãããã¨ããã¾ã§å®è¡ãã¾ãã
$ ssh localhost The authenticity of host 'localhost (127.0.0.1)' can't be established. RSA key fingerprint is dc:ef:1d:f9:6b:17:13:73:cf:2e:09:ce:34:46:af:14. Are you sure you want to continue connecting (yes/no)? yes # ãã㯠yes ã¨å ¥å Warning: Permanently added 'localhost' (RSA) to the list of known hosts. gitlabhq@localhost's password: # ããã¾ã§æ¥ãã Ctrl-C ã§çµäºã㦠OK
å ¬ééµãä½æãã git ã¦ã¼ã¶ã®ãã¼ã ãã£ã¬ã¯ããªã«ç§»åããã¦ããã¾ãã
$ ssh-keygen -t rsa -P "" -f ~/.ssh/gitadmin $ exit # root ã«æ»ãã¾ã # mv /home/gitlabhq/.ssh/gitadmin.pub /home/git
gitolite ã®ã¤ã³ã¹ãã¼ã«
git ã¦ã¼ã¶ã«ãªããgitolite ã github ãã clone ãã¤ã³ã¹ãã¼ã«ãã¾ãã
# su - git
$ git clone git://github.com/sitaramc/gitolite
$ gitolite/src/gl-system-install
/home/git/bin ã« PATH ãéããç¶æ ã§å ã»ã©ä½æããå ¬ééµãå¼æ°ã« gl-setup ãå®è¡ãã¾ãã
$ sh -c "PATH=/home/git/bin:$PATH; gl-setup /home/git/gitadmin.pub" The default settings in the rc file (/home/git/.gitolite.rc) are fine for most people but if you wish to make any changes, you can do so now. hit enter...
ãã㧠Enter ãã¼ãæ¼ãã¨è¨å®ãã¡ã¤ã« /home/git/.gitolite.rc ãéããç¶æ 㧠vi ãèµ·åããã®ã§ã$REPO_UMASK ã®å¤ã以ä¸ã®ããã«å¤æ´ãã¾ãã
$REPO_UMASK = 0077;
â
$REPO_UMASK = 0007;
å¤æ´ããã :wq ã§ä¿åãã¦çµäºããã¨ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ãæµã gitolite ã®ã¤ã³ã¹ãã¼ã«ã¯å®äºã§ãã
creating gitolite-admin... Initialized empty Git repository in /home/git/repositories/gitolite-admin.git/ creating testing... Initialized empty Git repository in /home/git/repositories/testing.git/ [master (root-commit) 7d38524] gl-setup /home/git/gitadmin.pub 2 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 conf/gitolite.conf create mode 100644 keydir/gitadmin.pub
gitlabhq ã¦ã¼ã¶ã§ã® SSH è¨å®
gitlabhq ã¦ã¼ã¶ã«ãªãã~/.ssh/config ãä½æãã¾ãã
$ exit # gitlabhq ã¦ã¼ã¶ã« su ãããã root ã«æ»ã # su - gitlabhq $ vi ~/.ssh/config
ç°å¢ã«åããã以ä¸ã®ãããªå 容ãè¨è¿°ãã¾ãã
Host localhost HostName localhost User git IdentityFile ~/.ssh/gitadmin
ä½æããã権éãå¤æ´ã
$ chmod 0600 ~/.ssh/config
ã¾ããgitlabhq ã¦ã¼ã¶ã§ã® git ã®åæè¨å®ãè¡ã£ã¦ããã¾ãã
$ git config --global user.email "[email protected]" $ git config --global user.name "gitadmin"
GitLab ã®ã¤ã³ã¹ãã¼ã«
root ã¦ã¼ã¶ã«ãªããå¿ è¦ãªã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ãã¾ãã
$ exit # root ã«æ»ãã¾ã # yum install -y python-devel python-pip redis libicu-devel # pip-python install pygments # gem install bundler --no-rdoc --no-ri
ã¤ã³ã¹ãã¼ã«ãå®äºããã Redis ãèµ·åãã¦ããã¾ãã
# service redis start
gitlabhq ã¦ã¼ã¶ã«ãªããv2.2.0 ã® tarball ãåå¾ãå±éãã¾ãã
# su - gitlabhq $ wget --content-disposition https://github.com/gitlabhq/gitlabhq/tarball/v2.2.0 $ tar xzf gitlabhq-gitlabhq-v2.2.0-0-g9e6d071.tar.gz $ ln -s gitlabhq-gitlabhq-8373315 gitlabhq
bundle install 㯠--deployment ãªãã·ã§ã³ä»ãã§å®è¡ãããã¨ã«æ³¨æãã¦ä¸ããã
$ cd /home/gitlabhq/gitlabhq $ bundle install --deployment --without development test
è¨å®ãã¡ã¤ã«ã®éå½¢ãã³ãã¼ãã¾ãã
$ cp config/database.yml.example config/database.yml $ cp config/gitlab.yml.example config/gitlab.yml
ç°å¢ã«åããã¦ãµã¼ãè¨å®ãå¤æ´ãã¾ãã
$ vi config/gitlab.yml
ããã§ã¯ host ããµã¼ãã®ãã®ã«å¤æ´ãã¾ããã
# Gitlab application config file # Email used for notification # about new issues, comments email: from: [email protected] host: gitlabhq.com # Git Hosting congiguration git_host: system: gitolite admin_uri: git@localhost:gitolite-admin base_path: /home/git/repositories/ host: 192.0.2.0 git_user: git # port: 22 # Git settings # Use default values unless you understand it git: # Max size of git object like commit, in bytes # This value can be increased if you have a very large commits git_max_size: 5242880 # 5.megabytes # Git timeout to read commit, in seconds git_timeout: 10
以ä¸ãå®è¡ãã¦åæãã¼ã¿ãæå ¥ãã¾ãã
$ bundle exec rake db:setup RAILS_ENV=production $ bundle exec rake db:seed_fu RAILS_ENV=production
ãã㧠db:seed_fu å®è¡å¾ã«ããã©ã«ãã®ç®¡çè ã¢ã«ã¦ã³ãæ å ±ã表示ãããã®ã§ã¡ã¢ãã¦ããã¾ãã
å®äºããããµã¼ããèµ·åãã¾ãã
$ bundle exec rails s -e production
ããã§ãã©ã¦ã¶ããã¢ã¯ã»ã¹ããã¨å
ã»ã© db:seed_fu å®è¡å¾ã«è¡¨ç¤ºãããã¢ã«ã¦ã³ãæ
å ±ã§ãã°ã¤ã³ã§ãã¾ãã
ãã°ã¤ã³ããããVisit Admin Areaãããæ°è¦ã«ç®¡çã¦ã¼ã¶ãç»é²ããããã©ã«ãã®ã¢ã«ã¦ã³ãã¯åé¤ãã¦ãããæ¹ãè¯ãã§ãããã
管çã¦ã¼ã¶ãä½æããããããã¸ã§ã¯ããä½æãã¦ã¿ã¦ãä¸æãè¡ãããã§ããã° GitLab ãµã¼ãã®æ§ç¯ã¯æåã§ãã
GitLab ããã®ããã¸ã§ã¯ãã®ä½æã«å¤±æããå ´åã«ã¯ãã£ã¬ã¯ããªã®ãã¼ããã·ã§ã³ãããè¦ç´ãã¦ã¿ã¦ä¸ããã
以ä¸ã§ GitLab ãµã¼ãæ§ç¯ã¯å®äºã§ãã
å¾ã¯ Passenger ã§èµ·åããããã«è¨å®ãããããã¨æãã¾ãããé·ããªã£ãã®ã§ããã¡ãã«ã¤ãã¦ã¯æ¬¡åã¾ã¨ãããã¨æãã¾ãã
åè
Fedora · gitlabhq/gitlabhq Wiki
https://github.com/gitlabhq/gitlabhq/wiki/Fedora
CentOS6.2(gitlab2.1+redmine1.3)(rvm+passenger+nginx) Vol.1 - studio3104::Blog::Infrastructure
http://studio3104.hatenablog.com/entry/2012/01/22/235052