Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell how far Jenkins has gotten in cloning a Git repo?

Tags:

git

jenkins

I've got a build running in Jenkins right now and all I can see in the console output is:

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

I understand this is probably because the Git process has not flushed its output stream yet; but it's frustrating because if I run a git clone from the terminal then I can clearly see a percentage updated in real time telling me how close the command is to being finished.

It wouldn't really matter except that:

  1. I need to shut down this machine soon.
  2. This particular repo takes a long time to clone (like over an hour).
  3. Therefore, if the clone is at, say, 90%, I want to let it finish. If it's more like 50% then I want to just kill the build and start it over in the morning.

Does anybody know if it's possible to somehow get the information I crave?

like image 529
Dan Tao Avatar asked Nov 03 '22 23:11

Dan Tao


1 Answers

  • Source code for GIT plugin
  • GIT clone flags

Search for clone and see where it checks the git version to determine if it passes the --progress flag. If your build is already going there is not much you can do, but for future reference this may be helpful.

--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.
like image 100
Tyler Smith Avatar answered Nov 07 '22 21:11

Tyler Smith