Install Phabricator and run on the Gitlab

最近跑的專案都是四個人以上同時開發,有時候程式碼被改了,Pull 下來改完衝突,發現程式碼都會錯亂。排除每個人對 Git 熟練度,我覺得 Gitlab 對於 Review code 做的似乎不是很友善。Scrum在跑的時候碰到這類型的問題,每次要解決都要花不少時間。

在某一次尋找 Git 相關教學的時候發現了一個蠻冷門的東西Phabricator,當初看到這套的時候第一印象就覺得這也是版本控制,所以加入最愛後就沒再理他,當碰到最近的問題,才想到我似乎在哪裡有看到這種問題的 Solution。

這一套 Phabricator 是 Facebook 釋出的 Open Source,Facebook 也是為了解決 Code Review, Track Bugs, Browse Source...等等這些問題才會開發這一套系統。

開始安裝

在官網是很詳細的安裝方式我在這邊粗略的介紹一下。

要使用 Phabricator 一定得先安裝 git, apache, mysql, php, php extensions (mbstring, iconv...等)

  • git (usually called "git" in package management systems)

  • Apache (usually "httpd" or "apache2") (or nginx)

  • MySQL Server (usually "mysqld" or "mysql-server")

  • PHP (usually "php")

  • Required PHP extensions: mbstring, iconv, mysql (or mysqli), curl, pcntl (these might be something like "php-mysql" or "php5-mysql")

  • Optional PHP extensions: gd, apc (special instructions for APC are available below if you have difficulty installing it), xhprof (instructions below, you only need this if you are developing Phabricator)

他還有些版本的限制,必需要注意。安裝以上是比較基本的,接下來就是 clone。

$ cd somewhere/ # pick some install directory
somewhere/ $ git clone git://github.com/facebook/libphutil.git
somewhere/ $ git clone git://github.com/facebook/arcanist.git
somewhere/ $ git clone git://github.com/facebook/phabricator.git

clone 下來最好就在 libphutil、arcanist、phabricator 先執行git pull因為我沒有這樣做,多花了一個小時找問題阿...結果根本就不是最新的版本。

另外可以選擇是不是要安裝 APC、XHProf

修改 httpd-vhosts.conf

我的東西大部份都是部屬在 Apache 上這個也不例外。所以我加上 sub domain 相關的參數。

設定完 domain 訪問設定的網址,依照指示要先設定 Mysql。

設定 Mysql

Phabricator upgrade

更新到最新的版本會有下列訊息。

更新完畢後再回去網頁,會看到登入畫面。

phabricator login

設定 Admin 帳號

最後就是需要開啟背景執行。

這樣就完成了,我覺得他的安裝非常簡單。安裝下來我也沒遇到什麼大問題。

與 Gitlab 串接

登入後在左邊的選單依序點選

ADMINISTRATION > Repositories > Create New Repository

表單中填入

Name: yout project name

Callsign: VCS

Type: Git

Callsign 為什麼是 VCS 因為這邊有相關的設定可以參考。

It is followed by the repository callsign, and then a VCS-specific commit identifier (for SVN, the commit number; for Git and Mercurial, the commit hash)。

下一步後依序設定:

Basics

Tracking: Enabled

Remote URI

Repository URI: your repository url

Repository Information

Local Path: your project path

Track Only: your want track branches

設定完就可以看到

phabricator create repository

點選 View in Diffusion 可以看到這個 repository 的各種記錄

phabricator repository track

若在某一次的記錄 review code 發現有問題都可以在 diffusion > Raise Concern,回報都會有紀錄存在直到消除 Raise Concern。

phabricator repository track tree

Sep 14th, 2013 11:09:00am

Last updated

Was this helpful?