服务器环境配置:安装 git,php,nginx
1.公钥配置
a.打开终端输入,生成公钥,如果没安装ssh,请先安装ssh
$ ssh-keygen -t rsa -C"youemail" #youemail为coding 对应项目的 邮箱
### 一路回车 将显示生成的公钥地址
### mac系统 一般地址为/Users/username/.ssh/id_rsa.pub ###username 为mac 用户名
### ubuntu 地址一般为 /root/.ssh/id_rsa.pub
$ vim /Users/username/.ssh/id_rsa.pub ###复制公钥
b.打开coding -> 项目 -> 设置 ->部署公钥 ->新增公钥
把秘钥复制到里面报错就行了
c.coding -> 项目 ->代码 ->SSH 方式访问仓库
复制地址
d.打开终端
$ git clone git@git.coding.net:xxx/xxx.git
能下载成功说明git ssh 配置成功.
2. php 作为GitHook 回调
逻辑思路:由于每次git 提交上来代码 GitHook 回调,这时候我们需要服务端开出接口来接收回调并且更新代码,从而实现持续交付
具体步骤情况连接 https://blog.coding.net/blog/GitHook-for-delivery-and-deployment