结合incron实现git自动发布

上个帖子讨论了git的自动web发布流程,但实际测试过程中发现存在用户权限问题,导致更新出错。今天在服务器上采用incron结合git进行自动发布,可以完美解决(或避开)权限问题。

1. git hooks post-receive部分

此处仅创建一个临时文件,比如heihedata.update.lck

#!/bin/bash

touch /home/wlx/heihedata.git/hooks/heihedata.update.lck

 

2. incron部分

使用incron监测post-receive生成的文件,然后使用root账号进行更新操作。

设置incron

/home/wlx/heihedata.git/hooks/heihedata.update.lck IN_CLOSE_WRITE /root/heihedata.sh

 

执行的脚本

#!/bin/bash

cd /home/wlx/heihedata.git

GIT_WORK_TREE=/var/www/heihedata.org/ git checkout heihedata -f

rm /home/wlx/heihedata.git/hooks/heihedata.update.lck

 


已发布

分类

来自

标签:

评论

《 “结合incron实现git自动发布” 》 有 13 条评论

  1. how to buy enclomiphene generic drug

    how to buy enclomiphene no prescription needed

  2. kamagra nuit sans consultation

    usa phizer marque hame kamagra de phizer

  3. online order androxal australia price

    discount androxal purchase toronto

  4. discount dutasteride cheap europe

    buy dutasteride in Ireland

  5. ordering flexeril cyclobenzaprine uk buy online

    ordering flexeril cyclobenzaprine price on prescription

  6. buy cheap gabapentin usa suppliers

    no prescription cod gabapentin

  7. fildena no script fedex

    purchase fildena generic cheap

  8. order itraconazole canada no prescription

    buy cheap itraconazole generic online cheapest

  9. order staxyn without rx

    how to buy staxyn uk pharmacy

  10. ordering avodart canada suppliers

    buy avodart cost per tablet

  11. how to buy xifaxan without a rx

    ordering xifaxan usa overnight delivery

  12. purchase rifaximin australia no prescription

    cheap rifaximin without rx

  13. kanadskテゥ lテゥkテ。rny bez lテゥkaナ冱kテゥho pナ册dpisu

    kamagra bezplatnテ。 pナ册prava fedexem

回复 buy rifaximin cheap with fast shipping 取消回复

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