Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Git repository recloning on every build #3967

tardis4500 ·

Even though I am using the same repo on every build, this message shows up:

Repository setting changed, deleting working directory

Why is this happening even though the repo hasn't changed?

  • replies 5
  • views 1364
  • stars 0
robinshen ADMIN ·

Have you cleaned up the workspace either in some steps or its pre/post execute actions?

tardis4500 ·

No. I can run a build and then turn around and run it immediately and get this in the log:

12:30:22,962 DEBUG - Loading scm rc file ...
12:30:22,963 INFO - Repository setting changed, deleting working directory [/home/qbadmin/agent/prod/workspace/392]
12:30:22,965 DEBUG - Creating git repository to directory [/home/qbadmin/agent/prod/workspace/392] ...

tardis4500 ·

Nevermind. I found a step that cleans the workspace. Let me update that. Thanks.

tardis4500 ·

I need to have the master workspace cleaned up of everything but what is necessary to prevent a re-clone of the git repo for getting git changes. I tried setting the configuration master pre-execute setting to "Delete specified files on current node" to ",-.qbcache/,-.git/**" but it's only deleting files and leaving behind empty directories. I also tried setting it to "Delete specified directory on current node" to "*,-.qbcache,-.git" but it doesn't accept file matching pattern. How can I get the result I want?

robinshen ADMIN ·

Please try below groovy script:

groovy:
for (file in configuration.workspaceDir.listFiles()) {
  if (file.name != ".qbcache" && file.name != ".git") {
    if (file.isFile())
      com.pmease.quickbuild.util.FileUtils.deleteFile(file);
    else 
      com.pmease.quickbuild.util.FileUtils.deleteDir(file);
  }
}