출처 : http://mudchobo.tistory.com/537

참고 : http://blog.saltfactory.net/175


gitlab 사이트입니다.
http://gitlabhq.com/
보면 사이트에서 Try It을 하면 체험할 수 있어요. 

아래 문서는 gitlab 공식 설치 페이지입니다.
https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md

이 문서대로 보고 하면 잘 되야는데, 저 같은 경우에는 뭔가 삑사리가 몇 번 났습니다. 뭔가 설치가 안되어있다고 자주 떴는데, 그래서 이것저것 모아보니 apt-get install로 이것저것 많이 설치해줘야 하더라구요.
제가 설치한 히스토리를 정리합니다.

요거 아래 것처럼 이렇게 많이 설치합니다.

sudo apt-get install build-essential git-core wget curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server python-dev python-pip libyaml-dev

그 다음 공식사이트에서 제공하는 루비 + gitolite를 한번에 설치해주는 스크립트를 실행합니다.

curl https://raw.github.com/gitlabhq/gitlabhq/master/doc/debian_ubuntu.sh | sh

근데, 저 같은 경우에는 마지막에 뭔가 퍼미션 에러랑 패스에러가 같이 나면서 설치가 잘 안된 것 같았습니다. 그래서 이 부분을 다시 했습니다. 이런 에러가 떴었어요.

 ***** WARNING *****
gl-setup is not in your $PATH.

Since gl-setup MUST be run from the PATH (and not as src/gl-setup or such),
you must fix this before running gl-setup.  The simplest way is to add

    PATH=/home/git/bin:$PATH

to the end of your bashrc or similar file.  You can even simply run that
command manually each time you log in and want to run a gitolite command.

그래서 패스잡아주는 게 잘 안된 것 같아 .profile만드는 부분 부터 다시 했습니다.

sudo -u git sh -c 'echo "PATH=\$PATH:/home/git/bin\nexport PATH" > /home/git/.profile'
sudo -u git -i -H /home/git/gitolite/src/gl-system-install
sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
sudo chmod 777 /home/git/gitlab.pub

sudo -u git -H sed -i 's/0077/0007/g' /home/git/share/gitolite/conf/example.gitolite.rc
sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gl-setup -q /home/git/gitlab.pub"

sudo chmod -R g+rwX /home/git/repositories/
sudo chown -R git:git /home/git/repositories/


sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
sudo rm -rf /tmp/gitolite-admin

해보니 테스트로 잘 받아지고, 잘 삭제가 되었습니다.
그 다음 문서에 4단계부터 하는 것은 그대로 진행하면 잘 됩니다.

sudo gem install charlock_holmes
sudo pip install pygments
sudo gem install bundler
cd /home/gitlab
sudo -H -u gitlab git clone git://github.com/gitlabhq/gitlabhq.git gitlab
cd gitlab
sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml
sudo -u gitlab cp config/database.yml.sqlite config/database.yml
sudo -u gitlab -H bundle install --without development test --deployment
sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production

이렇게 하면 설치가 잘 됩니다. 또 저 같은 경우에는 pygments 설치하다가 잠시 다운로드 에러가 나서 안된 경우도 있었는데, 에러가 났는지 잘 확인하시고, 에러나면 다시 시도해서 하면 될 것 같습니다.

그 다음 서버를 시작하면 끝입니다.

sudo -u gitlab bundle exec rails s -e production -d


http://서버ip:3000/ 하면 로그인 하라고 뜨고, 로그인 아이디와 비번은 db셋팅할 때 나오는 것처럼 
admin@local.host
5iveL!fe
하면 됩니다.

'형상관리' 카테고리의 다른 글

[형상관리] Linux - Centos svn  (0) 2014.06.23
[형상관리] linux-Centos 5 Git Server 설치  (0) 2014.06.10
[형상관리] Git 설명  (0) 2013.11.27
[형상관리] Git 설치 및 사용  (0) 2013.11.27
[형상관리] Git 사용법  (0) 2013.06.28

+ Recent posts