Also, this process will need to get the latest file from the repository regardless of what P4 revision the parent build used. I can't seem to find any examples of how to get the latest Perforce revision number and update the workspace accordingly.
Also, this process will need to get the latest file from the repository regardless of what P4 revision the parent build used. I can't seem to find any examples of how to get the latest Perforce revision number and update the workspace accordingly.
groovy:
def sourceBuild = configuration.parent.latestBuild;
vars.get("someVar").setValue(sourceBuild.getVarValue("someVar"));
vars.get("someOtherVar").setValue(sourceBuild.getVarValue("someOtherVar"));
The Build Condition under "General Settings" is set to "If changes found in referenced repositories". I have some grooy code in the build condition to determine the parent configuration. I tested this code in a text input variable to make sure that the repository is correct. The formatting matches what is shown for Perforce repositories in the QuickBuild 5.0 documentation (it is a single line repository path and filename).
Is there something I may be missing that is preventing the repository change from triggering a build?
Build Condition: "If changes found in referenced repositories"
${groovy:
String config_trailer = "/BuildScripts/PortReview/TicketList.txt"
if ( configuration.parent.getName() == "MAIN") {
result = "//ISW/" + configuration.parent.getName() + config_trailer;
\} else {
result = "//ISW/REL/" + configuration.parent.getName() + config_trailer;
\}
return result;
}
repositories.get("your perforce repo name").takeSnapshot();
And then configure the build condition to evaluate a script (instead of using the default "If changes found in referenced repositorie"):
groovy:
def config_trailer = "/BuildScripts/PortReview/TicketList.txt"
def result
if ( configuration.parent.getName() == "MAIN") {
result = "//ISW/" + configuration.parent.getName() + config_trailer;
} else {
result = "//ISW/REL/" + configuration.parent.getName() + config_trailer;
}
return repositories.get("your perforce repo name").isChanged(result);
The configuration has a Repository Checkout step (the repository is set to NORMAL_SYNC). I tried modifying the build condition as you mentioned, and it still didn't run the job when the TicketList.txt file was updated.
The build condition above is set to run "If changes found in referenced repositories". I would expect that when a change to the TicketList.tx file is made in Perforce, that the build configuration is then run automatically.