【发布时间】:2020-06-05 01:53:31
【问题描述】:
我在 Apache 服务器上设置了 Git,一切正常。现在我想设置一个接收后挂钩来启动 Jenkins 构建。
我已经编写了脚本并在服务器上测试了它,没有问题。但是,当我执行git push 时,它会到达“总计”行并停止:
C:\develop\.ws\git-repo>git push
Username for 'https://internal.git.repo.com': user
Password for 'https://user@internal.git.repo.com':
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes | 289.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
查看服务器,我可以看到脚本已尝试启动,但它被挂起并使用了一个内核的 CPU:
由于脚本似乎引起了问题,我只是通过重命名删除“示例”扩展名来尝试示例脚本,但它表现出相同的行为。所以我将脚本更改为:
#!/bin/sh
exit 0
或
#!C:/git-2.25.1/bin/sh.exe
exit 0
但还是一样。
发生了什么事?
【问题讨论】: