Separate Git Deployments on a Single Server

Deadly 提交于 2019-12-01 12:55:56
VonC

I think we'll have a Git deploy framework that will checkout the appropriate branch on the server.

That is a good approach, but it need to checkout/update the appropriate branch in different folders (and your webapp need to redirect pages according to the user choice)

A post-receive hook is typically used in order to trigger a per-branch process: see for instance "how to process files on a branch in post-receive hook in git"

#!/bin/bash

while read oldrev newrev ref
do
  branch=`echo $ref | cut -d/ -f3`

  if [ "master" == "$branch" ]; then
    ....
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!