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.
In post execute condition of the checkout step, use below script:
groovy:
def repo = repositories.get("perforce repo name");
if (repo.getShelveSupport() != null && repo.getShelveSupport().getActualShelvedChanges() == null || repo.getShelveSupport().getActualShelvedChanges().isEmpty())
throw new com.pmease.quickbuild.QuickbuildException("No shelved changes to build");
This isn't working. This if failing if NO changelist is specified, but not if a specified CL is empty (contains no shelved files).
What we want is:
1. Do not fail if no shelved CL is specified (this okay, sometimes we build regression builds this way)
2. Fail if shelved CL is specified, but its contents is empty. (Multiple CL's can be specified by listing them between commas)
3. Do not fail if shelved CL's all contain files.
Thanks
Thanks for the clarification. I filed a ticket to address this:
http://track.pmease.com/browse/QB-2705
Approximately how long would it take for this ticket to be resolved or to be added on QB?
For urgent features, we can put them into next one or two patch releases which should be available in one or two weeks. If you feel this is important, please vote for the issue.
You can make a call to 'p4' in the build's Pre-Queue event script or within a build script-type step. Parse the output using RegEx. If the CL is empty, throw a QB exception. Sample:
for (changelist in vars.get("p4_shelved_changelist").asList()) {
output = util.readOutput("p4 -C utf8 -c ${repositories.get("p4Repo").getClientName()} -p ${repositories.get("p4Repo").getPort()} -u ${repositories.get("p4Repo").getUserName()} -P ${repositories.get("p4Repo").getTicket(repositories.get("p4Repo").getUserName(), repositories.get("p4Repo").getPassword())} describe -s -S " + changelist)
// Check for files in the changelist
m = output =~ /Shelved files \.\.\.([\w\W]+)$/;
if (! (m && m[0][1].trim() != "") )
throw new QuickbuildException("Shelved changelist does not contain any files: " + changelist)
}
This has been used successfully with QB 5.1. I'd assume it would also work with QB 6.x, but have not tested it.
Cheers.
EDIT:
This You can make a call to 'p4' in the build's Pre-Queue... should be: You can make a call to 'p4' in the configuration's Pre-Queue...
Also, substitute "p4Repo" for the name of your Perforce Repository.