有没有办法告诉 Jenkins 在克隆 Git 存储库方面取得了多大进展?

Dan*_*Tao 5 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 repository
Cloning repository origin
Run Code Online (Sandbox Code Playgroud)

我理解这可能是因为 Git 进程尚未刷新其输出流;但这令人沮丧,因为如果我git clone终端运行 a ,那么我可以清楚地看到实时更新的百分比,告诉我命令距离完成有多近。

除了:

  1. 我需要尽快关闭这台机器。
  2. 这个特定的 repo 需要长时间才能克隆(比如一个多小时)。
  3. 因此,如果克隆达到 90%,我想让它完成。如果它更像是 50%,那么我只想终止构建并在早上重新启动它。

有谁知道是否有可能以某种方式获得我渴望的信息?

Tyl*_*ith 2

搜索克隆并查看它在哪里检查 git 版本以确定它是否通过 --progress 标志。如果您的构建已经开始,那么您无能为力,但为了将来的参考,这可能会有所帮助。

--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.
Run Code Online (Sandbox Code Playgroud)