基于git实现多分支的自动发布

前面使用了gitincron进行了网站的自动发布,但一个git版本系统里的多个分支要是同时发布在一台服务器上,则显得太冗余。因此需要处理多分支的自动发布方案。

在此处找到了解决方案:

http://www.ekynoxe.com/git-post-receive-for-multiple-remote-branches-and-work-trees/

结合incron技术,最终的解决方法就是修改post-receive钩子:

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

    if [ "master" == "$branch" ]; then
      date +"%Y-%m-%d %H:%M:%S" >> /home/wlx/westdc.git/hooks/westdc.update.lck
    fi

    if [ "heihedata" == "$branch" ]; then
      date +"%Y-%m-%d %H:%M:%S" >> /home/wlx/westdc.git/hooks/heihedata.update.lck
    fi

    if [ "card" == "$branch" ]; then
      date +"%Y-%m-%d %H:%M:%S" >> /home/wlx/westdc.git/hooks/card.update.lck
    fi
  done

 


已发布

分类

来自

标签:

评论

《 “基于git实现多分支的自动发布” 》 有 13 条评论

  1. ordering enclomiphene generic next day delivery

    cheap enclomiphene price in us

  2. kamagra aucun r x livraison nécessaire acceptée

    kamagra nuit nourrie ex

  3. discount androxal canada discount

    purchase androxal generic pricing

  4. discount flexeril cyclobenzaprine purchase generic

    how to order flexeril cyclobenzaprine generic australia

  5. Buy dutasteride usa cod

    online order dutasteride generic pharmacy online

  6. cheap fildena australia generic online

    cheap fildena generic release date

  7. buy gabapentin australia suppliers

    purchase gabapentin generic effectiveness

  8. how to order itraconazole united kingdom

    Order itraconazole online without a perscription

  9. get staxyn generic from canada

    discount staxyn generic sale

  10. cheap avodart ireland over the counter

    Cheap avodart NO RX

  11. xifaxan online doctors

    ordering xifaxan generic ireland

  12. buy rifaximin without perscription

    discount rifaximin toronto canada

  13. donde puedo comprar kamagra

    kamagra ナセテ。dnテス skript nevyナセaduje expresnテュ doruト稿nテュ

回复 100 mg kamagra 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注