Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 Gitblit 服务器上设置接收后挂钩脚本,它将更改拉到同一服务器上的网站。在 bash 脚本中,命令看起来像这样:
sudo git --work-tree=/var/www/html/mysite --git-dir=/var/www/html/mysite/.git pull
但据我了解,Gitblit 使用 groovy hooks 脚本,我对此完全陌生。有人可以帮我为此创建一个 groovy 脚本,或者至少指导我一些很好的 Groovy 示例或教程。
谢谢
如果有人需要 groovy 方面的帮助,这是我的 groovy 脚本:
import org.slf4j.Logger def res = ["git", "--work-tree=/var/www/html/mysite", "--git-dir=/var/www/html/mysite/.git", "pull"].execute() println res.err.text println res.text