1
SpicyCat 2016-06-14 12:50:59 +08:00 1
先确认下 post-receive 有没有正常触发,然后确认触发后有没有报错。
话说这种部署的任务应该用 CI 来做吧。 |
2
wzxjohn 2016-06-14 12:52:33 +08:00 1
钩子没错,如果可以的话建议把钩子代码发出来看下,去掉敏感信息
|
3
tabris17 OP |
5
wzxjohn 2016-06-14 14:49:23 +08:00 1
@tabris17 刚才没说完就回了。。。
因为 post-update 和 post-receive 都是所有 ref 更新完了才执行,所以先后顺序应该是不会影响的,只是时间问题而已。从描述和代码里也可以看出这两个是紧挨着执行的,没有太大的区别。 post-receive Hook ----------------- After all refs were updated (or attempted to be updated), if any ref update was successful, and if $GIT_DIR/hooks/post-receive file exists and is executable, it will be invoked once with no parameters. post-update Hook ---------------- After all other processing, if at least one ref was updated, and if $GIT_DIR/hooks/post-update file exists and is executable, then post-update will be called with the list of refs that have been updated. https://github.com/git/git/blob/master/builtin/receive-pack.c#L1772 |
6
tabris17 OP 搞定了,之前确实是 git update-server-info 和部署代码脚本的执行顺序问题。
然后把 exec git update-server-info 的 exec 去掉,后面的部署代码就能正确执行了 |
7
julyclyde 2016-06-15 13:46:05 +08:00
那看来你是根本不知道 exec “是什么”,就随便用
|