The Phabricator of docker build

Phabricator 是一套專案管理工具。...

Phabricator 是一套專案管理工具。下次補上 Arcanist 的 Code Review

Installation Requirements

  • docker environment
  • docker-compose

Installing

已將 Phabricator Docker 整理完畢,並且依環境修改 docker-compose.yml

$ docker-compose up -d

登入 Phabricator Container

Core

$ ./phabricator/bin/config set phabricator.timezone "Asia/Taipei"
$ ./phabricator/bin/config set phabricator.base-uri "http://geniusnet.io:8081/"
$ ./phabricator/bin/config set auth.login-message "<html><body style='margin: 0px'><br /><h1 style='text-align: center'>Hardworking!</h1><img style='-webkit-user-select:none; display:block; margin:auto;' src='http://pic.pimg.tw/markleeblog/1383024945-1385249613.jpg?v=1383024946'></body></html>"

Storage

$ ./phabricator/bin/config set storage.local-disk.path "/opt/backup/storage/"
$ ./phabricator/bin/config set security.alternate-file-domain "http://YOUR_PHABRICATOR_DOMAIN:8081/"

Repository 在這邊的設定會影響到,設定 Diffusion 鏡像 Repository 的位置,也會影響到備份。

$ ./phabricator/bin/config set repository.default-local-path "/var/repo/"

Mail config

$ ./phabricator/bin/config set phpmailer.smtp-host "smtp.gmail.com"
# 如果您已嘗試將 SMTP 伺服器的連接埠設為 465 (適用 SSL) 和 587 (適用 TLS),但仍無法傳送郵件。
$ ./phabricator/bin/config set phpmailer.smtp-port 465
$ ./phabricator/bin/config set phpmailer.smtp-user "EMAIL_ACCOUNT"
$ ./phabricator/bin/config set phpmailer.smtp-password "PASSWORD"
$ ./phabricator/bin/config set phpmailer.smtp-protocol "ssl"
$ ./phabricator/bin/config set metamta.default-address "EMAIL_ACCOUNT"
$ ./phabricator/bin/config set metamta.domain "YOUR_PHABRICATOR_DOMAIN"

Show Prototypes

$ ./phabricator/bin/config set phabricator.show-prototypes true

按照順序啟動

$ docker start phabricator_database phabricator_phabricator

Daemons restart

$ ./phabricator/bin/phd restart

無法刪除 Daemons 時試試看。

$ ./phabricator/bin/storage upgrade

Mail

改變寄送郵件方式

Config > Mail > metamta.mail-adapter : PhabricatorMailImplementationPHPMailerAdapter

若是在Google Account有不同的登入方式,例如兩段式驗證,會使得SMTP無法正常運作

Backup

$ docker exec -it CONTAINER_ID /bin/sh /opt/phabricator/backup.sh

Profile Settings

各種與自身相關的設置,包含圖片、SSH Key等等

SSH Public Keys

SSH Public Keys 要提交 arc 必須要先將自己的 key 上傳,或是產出再下載。

Email Notice

Email 各種通知的接收管道,可以在此設置

Conduit API Tokens

Conduit API Tokens 與 arc 或是其他 API 串接時,會在這邊顯示。

Conpherence

Conpherence 即時訊息的溝通平台。

Panel

Panel 編輯方便自己使用的目錄。

Dashboard

Dashboard 編輯自己快速瀏覽的煮版面。

Phriction

Phriction 是用來做需求、開發或是規格的記錄文件,採用 Remark 的方式撰寫,試過 Markdown 可以無痛轉移。

Pastes

Pastes 用來張貼各種語法,透過這個功能可以順利地表達程式碼。

Pholio Mock

Pholio Mock 運用圖片表達文字無法傳達的意思,可以在圖片上註記要注意或是溝通的事項。

Diffusion

新增 Repository 流程

  1. Import an Existing External Repository
    1. Git
  2. Choose a human-readable name: PROJECT_NAME
  3. Callsigns must be UPPERCASE: WEB
  4. Enter the URI to clone this Git repository: RESPOSITORY_URL
  5. Add Credential
  6. Create Credential

Phabulous (notice for slack)

已將 Phabulous 的 Docker 整理完畢

  • Ubuntu 14.04 LTS
  • gvm
  • go 1.4

GVM & Go Install

$ bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
$ gvm install go1.4
$ gvm use go1.4 [--default]

Library Install

$ go get github.com/mitchellh/gox
$ go get github.com/Sirupsen/logrus
$ go get github.com/facebookgo/inject
$ go get github.com/jacobstr/confer
$ go get github.com/codegangsta/cli
$ go get github.com/gin-gonic/gin
$ go get github.com/nlopes/slack
$ go get github.com/etcinit/phabulous

Phabulous make & start

git clone from https://github.com/etcinit/phabulous

$ make && ./build/phabulous_linux_amd64 serve
alan@alan-H97M-D3H:~/go/phabulous$ kill -9 8946 && ./build/phabulous_linux_amd64 serve
DEBU[0000] Logger is debug level.
DEBU[0000] Booted upper layer.
INFO[0000] Starting up the server... (a.k.a. coffee time)
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET   /                         --> github.com/etcinit/phabulous/app/controllers.*FrontController.(github.com/etcinit/phabulous/app/controllers.getIndex)·fm (3 handlers)
[GIN-debug] GET   /healthcheck              --> github.com/etcinit/phabulous/app/controllers.*FrontController.(github.com/etcinit/phabulous/app/controllers.getHealthCheck)·fm (3 handlers)
[GIN-debug] POST  /v1/feed/receive          --> github.com/etcinit/phabulous/app/controllers.*FeedController.(github.com/etcinit/phabulous/app/controllers.postReceive)·fm (3 handlers)
[GIN-debug] Listening and serving HTTP on :8086
INFO[0000] Starting RTM handler...
DEBU[0000] RTM Event received.
DEBU[0003] RTM Event received.
...省略

另外要在 Phabricator 設置 feed hooks

$ ./phabricator/bin/config set feed.http-hooks '["http://YOUR_PHABRICATOR_DOMAIN:8086/v1/feed/receive"]'

若是有成功送出通知,會有 log 顯示。

DEBU[6417] epoch=1453355944&storyAuthorPHID=PHID-USER-hshw6rbaixcnjaedzhf2&storyData%5BobjectPHID%5D=PHID-DREV-ck47rwvcxhujb7sglbwf&storyData%5BtransactionPHIDs%5D%5BPHID-XACT-DREV-5mu2ffzccqgtwcq%5D=PHID-XACT-DREV-5mu2ffzccqgtwcq&storyData%5BtransactionPHIDs%5D%5BPHID-XACT-DREV-5rnlgp26j6n7jmc%5D=PHID-XACT-DREV-5rnlgp26j6n7jmc&storyData%5BtransactionPHIDs%5D%5BPHID-XACT-DREV-b4mol6ocdcu524s%5D=PHID-XACT-DREV-b4mol6ocdcu524s&storyData%5BtransactionPHIDs%5D%5BPHID-XACT-DREV-uqkmceoz4ja5no6%5D=PHID-XACT-DREV-uqkmceoz4ja5no6&storyID=9&storyText=root+requested+changes+to+D1%3A+add+arcconfig.&storyType=PhabricatorApplicationTransactionFeedStory
[GIN] 2016/01/21 - 13:59:07 | 200 |  1.455306608s | 172.17.0.6:55900 |   POST    /v1/feed/receive
DEBU[6423] RTM Event received.

Scrum Flow

可以輸入 store point 最後還有 Burndown chart 可以看

$ ./phabricator/bin/config set load-libraries '{"sprint":"/opt/libext/sprint/src"}'
$ ln -s /opt/libext/sprint/rsrc/webroot-static /opt/phabricator/webroot/rsrc/sprint

Phabricator-Sprint

Maniphest

Task export to Excel

PHP 必須先支援輸出 Excel

# 可以用語法找出include的路徑
print_r(get_include_path());
/opt:.:/usr/share/php:/usr/share/pear

$ git clone https://github.com/PHPOffice/PHPExcel.git /usr/share/php
$ vim /etc/php5/cli/php.ini
# search ;include_path and append
include_path = ".:/usr/share/php:/usr/share/php/PHPExcel/Classes"

$ vim /etc/php5/apache2/php.ini
# search ;include_path and append
include_path = ".:/usr/share/php:/usr/share/php/PHPExcel/Classes"
apachectl restart

只要支援就可以在 Maniphest 的頁面選擇 Export to Excel

Alan

Read more posts by this author.