상세 컨텐츠

본문 제목

ubuntu 16.04 gerrit gitweb 설치 방법 (gerrit repository browser 설치)

IT : Ubuntu

by 휀스 2017. 3. 4. 15:56

본문





먼저 gerrit 에서 gitweb 을 사용하려면 gitweb 이 설치되어 있어야 합니다.


gitweb 설치는 


$ sudo apt-get install gitweb


이후 /etc/gitweb.conf 파일을 수정해 줍니다.


다른 것은 건들지 말고 projectroot 만 수정하면 됩니다.

위치는 gerrit 에서 사용하는 git 최상위 폴더 입니다.


$projectroot = "/var/www/repo/";


이렇게 설정 후 web server 를 다시 시작하면 됩니다.


$ sudo service apache2 restart



gitweb 설치가 된 후 화면에서 cgi 소스코드가 보인다면 apache 에서 cgi module 이 enable 되지 않은 상태이므로 아래 명령을 실행해 줍니다.


$ sudo a2enmod cgi


gitweb 설치 완료 후 gerrit 의 config 를 수정해 줍니다.


$ git config --file $site_path/etc/gerrit.config gitweb.cgi /usr/lib/cgi-bin/gitweb.cgi

$ git config --file $site_path/etc/gerrit.config --unset gitweb.url

$ git config --file $site_path/etc/gerrit.config gitweb.url http://YOUR_GITWEB_URL/


위 설정으로 되지 않을 경우(Project name과 git name 이 다를 경우) 아래 설정을 추가로 해줍니다.


$ git config -f $site_path/etc/gerrit.config gitweb.type custom

$ git config -f $site_path/etc/gerrit.config gitweb.project ?p=\${project}.git\;a=summary

$ git config -f $site_path/etc/gerrit.config gitweb.revision ?p=\${project}\;a=commit\;h=\${commit}

$ git config -f $site_path/etc/gerrit.config gitweb.branch ?p=\${project}\;a=shortlog\;h=\${branch}

$ git config -f $site_path/etc/gerrit.config gitweb.roottree ?p=\${project}\;a=tree\;hb=\${commit}

$ git config -f $site_path/etc/gerrit.config gitweb.file ?p=\${project}\;hb=\${commit}\;f=\${file}

$ git config -f $site_path/etc/gerrit.config gitweb.filehistory ?p=\${project}\;a=history\;hb=\${branch}\;f=\${file}


$site_path 부분을 자신에게 맞게 변경필요.





이후 gerrit 을 재 시작하면 repository browser 에 gitweb link 가 생기게 됩니다.


이상 ubuntu 16.04 gerrit gitweb 설치 방법 (gerrit repository browser 설치)에 대한 글 이였습니다.


관련글 더보기