ubuntu搭建Phabricator

安装mysql5.7, nginx

安装 php7.1



sudo apt-get install software-properties-common
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update

sudo apt-get -y install php7.1
sudo apt-get -y install php7.1-mysql
sudo apt-get install php7.1-fpm

apt-get install php7.1-curl php7.1-xml php7.1-mcrypt php7.1-json php7.1-gd php7.1-mbstring

 

nginx配置:

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    use   epoll;  
    worker_connections  65535;
}


http {
    include mime.types;
    default_type  application/octet-stream;
    log_not_found off;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" "$host" '
    	'$status $body_bytes_sent "$http_referer" '
    	'"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;

    keepalive_timeout  75s;
    client_max_body_size       100m;

    gzip on;
    gzip_http_version 1.0;
    gzip_min_length 1000;
    gzip_proxied any;
    gzip_types text/css text/xml application/x-javascript text/plain application/json  application/xml application/javascript;
    gzip_comp_level 5;

server {
  server_name YOU_DOMAIN;
  root        /opt/phabricator/webroot/;
  try_files $uri $uri/ /index.php;


  location / {
    index index.php;
    rewrite ^/(.*)$ /index.php?__path__=/$1 last;
  }

  location /index.php {
    fastcgi_pass   localhost:9000;
    fastcgi_index   index.php;

    #required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;

    #variables to make the $_SERVER populate in PHP
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;

    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;

    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

    fastcgi_param  REMOTE_ADDR        $remote_addr;
  }
}

}

 

下载phabricator

$ cd somewhere/ # somewhere我选择的 /opt/
somewhere/ $ git clone https://github.com/phacility/libphutil.git
somewhere/ $ git clone https://github.com/phacility/arcanist.git
somewhere/ $ git clone https://github.com/phacility/phabricator.git

 

编辑 /etc/php/7.1/fpm/pool.d/www.conf

listen = /run/php/php7.1-fpm.sock
listen = 9000


listen.allowed_clients = 127.0.0.1

重启php服务

service php7.1-fpm stop
service php7.1-fpm start

 

重启nginx

添加mysql用户

mysql -rroot -p
>grant all privileges on `phabricator\_%`.* to 'phabricator'@localhost identified by 'phabricator';

 

设置phabricator

cd /opt/phabricator/bin
./config set mysql.host localhost
./config set mysql.port 3306
./config set mysql.pass phabricator
./config set mysql.pass phabricator

#更新数据库
./storage upgrade

进入web界面,创建admin用户,解决issue

 

 

Arcanist是Phabricator的命令行接口.

安装:

# sudo apt-get install php5 php5-curl   # ubuntu 系统
# sudo yum install php5 # centos 系统

# cd /usr/local/bin    # 安装目标路径, 如目录不在PATH, 则将 export PATH=$PATH:/usr/local/bin 加入 .bashrc
# git clone https://github.com/phacility/libphutil.git
# git clone https://github.com/phacility/arcanist.git
# ln -s arcanist/bin/arc arc # 创建软链接, 使arc命令位于PATH中
在.bashrc加入下面一行, 使arc命令可以自动补全:
source /usr/local/bin/arcanist/resources/shell/bash-completion

注:   ( 或用 npm 安装: npm install -g arcanist , 无需配置, 参见 https://www.npmjs.com/package/arcanist )

配置:

在git库目录创建 .arcconfig, 内容如下:

{
      "phabricator.uri" : "http://HOSTNAME",
      "editor": "vim",
      "base": "git:merge-base(FETCH_HEAD)"
}

安装证书:

# arc install-certificate
会提示用浏览器打开一个链接,登录并获取一个Token,复制该 Token, 粘贴到终端即可


工作流程:

1. 运行 git commit -am "修复了 XX BUG" ,commit你的改动
2. 运行 arc diff ,提交Differential,它会提醒你填写一些信息:
  Test Plan - 必填,详细说明你的测试计划;
  Reviewers - 必填,审查人的账户,多个使用","隔开;
  Subscribers - 非必填订阅人,多个使用","隔开。
  提交成功后,审查人就能在Differential收到通知
3. 如果 review 没有通过,你需要在原来的基础上修改,修改完并 commit 之后需要执行 arc diff --update D(id) 继续 review
4. 如果 review 通过了,只需要运行 arc land --onto dev, 将代码push到dev分支

 
命令参考:
arc help --full # 查看详细帮助
arc diff  # 提交默认的diff, arc diff origin/develop, 指定diff的分支,注意origin后是斜线
arc diff xxx --preview  # 提交针对某个分支的commit,并只生成diff文件,不在web端创建revision
arc which # 查看arc diff 会提交哪个范围的diff
arc land  # 提交代码,删除该分支 或 使用 git push
arc list  # 查看有哪些revision和其状态


参考网址:
http://share.zuijiao.net/?p=22
https://secure.phabricator.com/book/phabricator/article/arcanist/
https://secure.phabricator.com/book/phabricator/

https://secure.phabricator.com/book/phabricator/article/installation_guide/

https://secure.phabricator.com/book/phabricator/article/configuration_guide/

http://stackoverflow.com/questions/1720244/create-new-user-in-mysql-and-give-it-full-access-to-one-database

 

转载于:https://my.oschina.net/sukai/blog/872483

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值