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.

Repository not checking out correctly #3821

jperezri ·

I have a configuration that has a build condition scripts where it modifies a variable that is being used as the Change Number in a Perforce repository.
But when the build automatically runs, the log states that is checking out an older number revision instead of the one that the build condition script changed, and when you check the build variables the change number variable is fine, and seems like the repository didn't update correctly.

Could this be a problem of the build condition not giving enough time to the repository to update?
Is there a way to update the repository variables when the build is already running, like on an execute script step?

  • replies 3
  • views 1070
  • stars 0
robinshen ADMIN ·

QB determines the revision for checkout at snapshot taking stage (defined in advanced setting of configuration), which happens before checking build condition. You may script the snapshot taking script to do something like below:

groovy:
// modify the change number variable
for (repo in configuration.getReferencedRepositories())
  repo.takeSnapshot();

Another approach is to put the logic of calculating revision directly into value of the change number variable, for instance the change number variable can be scripted as:
${groovy: logic to calculate the revision}
This way you do not need to care about at which place to modify change number variable.

jperezri ·

The problem is that I'm getting the change number on the build condition script, is there any way to make the snapshot be took after or before a step of the build runs?

robinshen ADMIN ·

You may call below statement after changing the change number:
repositories.get("repo name").setRevision(null);
This will force QB to re-take snapshot.