GIT 代码自动部署

来源:互联网 发布:四川省网络信息办公室 编辑:程序博客网 时间:2024/05/16 07:43

hooks

下面

post-receive

chmod a+x post-receive


vim post-receive

 16 unset GIT_DIR
 17 WwwPath=/var/www/html/weixinevent1
 18 cd $WwwPath
 19 git pull origin master
 20 rsync -az --progress --exclude=.git  /var/www/html/weixinevent1/* root@XXXXXX:/alidata/www/XXXXX
~                                                                                                                                                   
~                                                                                                                                                   
~                                                                                                                                                   
~                         

0 0