有没有办法告诉詹金斯在克隆Git回购协议方面取得了多大进展?
我现在已经在Jenkins中运行了一个构建,在控制台输出中可以看到:有没有办法告诉詹金斯在克隆Git回购协议方面取得了多大进展?,git,jenkins,Git,Jenkins,我现在已经在Jenkins中运行了一个构建,在控制台输出中可以看到: Started by user anonymous Building in workspace /var/lib/jenkins/workspace/Main Checkout:Main / /var/lib/jenkins/workspace/Main - hudson.remoting.LocalChannel@820ea4 Using strategy: Default Cloning the remote Git re
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/Main
Checkout:Main / /var/lib/jenkins/workspace/Main - hudson.remoting.LocalChannel@820ea4
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
我理解这可能是因为Git进程尚未刷新其输出流;但这很令人沮丧,因为如果我从终端运行一个git克隆
,那么我可以清楚地看到实时更新的百分比,告诉我命令完成的距离有多近
这其实并不重要,除非:
--progress
Progress status is reported on the standard error stream by default
when it is attached to a terminal, unless -q is specified. This
flag forces progress status even if the standard error stream is
not directed to a terminal.
我看到了类似的症状,我发现这是由Jenkin的Git plugin clone()方法中递归删除工作区引起的(请参见下面的代码片段)。在我的例子中,我们有许多作业共享一个自定义工作区,因此delete调用需要几个小时才能完成。删除自定义工作区后,克隆操作成功完成 发件人:
(这应该是对前面答案的评论,但我还没有代表发表评论。)您有什么版本的GIT?
final String source = remoteConfig.getURIs().get(0).toPrivateString();
listener.getLogger().println("Cloning repository " + source);
final int[] gitVer = getGitVersion();
try {
workspace.deleteRecursive(); // This line was taking forever
} catch (Exception e) {
e.printStackTrace(listener.error("Failed to clean the workspace"));
throw new GitException("Failed to delete workspace", e);
}