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.
I have some repository definition that I would like to run a daily summary against and generate change sets for.
I have a configuration setup like this:
----- in root/Build lives a repository definition for perforce "My Repo"
I would like for root/Build/Summary to populate changesets and send out a email at the end of each day. I have the start and end cl.
I am attempting the following groovy script:
def repo = repositories.get(vars.getValue("RepositoryName"));
def startCL = new com.pmease.quickbuild.plugin.scm.perforce.PerforceRevision( vars.getValue("LastSuccessfulCL") )
def endCL = new com.pmease.quickbuild.plugin.scm.perforce.PerforceRevision( vars.getValue("LatestCL") );
repo.setRevision( startCL );
// What do here?
repo.getChanges(); /// ????
I want to refrain from causing root/Build/Summary to sync at night.
Everything I seem to be trying is not actually populating any change sets into the build root/Build/Summary. Could you assist me where I might have made an error?
You may add a record changes step referencing your perforce repository. The record changes step will not sync files from Perforce, but can still show changes between builds.
When using this step, groovy script will not be necessary.
How do I configure the start and end changelist for the Record Changes step type?
Changing starting/ending changeset is a bit cubersome. By default QB will use changeset number of last successful build as starting changeset, and current changeset in p4 repository as ending changeset.
This is why I am trying to do a groovy based solution.
Also If I run reporting configuration while a build is in progress, I want to make sure my change numbers are correct for the period I want to report on.
I could also calculate this manually (via parsing p4 changes output with script), but then how would I add the changeset data to Quickbuild? A much easier solution seems would be telling the reporting functions a starting and ending point.
From your groovy script, looks like that you just want to get changes between last successful build and current build. This is what QB currently does. Or am I misunderstanding something here?
You are misunderstanding. I would like a custom range; the names of variables are just used for understanding which 2 variables are being modified.
vars.getValue("LastSuccessfulCL") // start CL
vars.getValue("LatestCL") // end CL
I am using these as example since that is what is most relevant. However I want to do complete custom range (not what quickbuild does out of the box with repository step type), because there may be some build failed before there is a successful builds. Also I want to make a report for users each night containing all changes for the day (or ideally since the last promoted build).
I either need some sample code for:
- Making the change set work with a starting and ending changelist number.
- Add to the change set dynamically
I have tried to locate some similar code to this on the forum and searching java doc, but I am not sure what to do beyond that.
Unfortunately QB repository will always report changes between last build and current build. Getting changes between arbitrary change number is not supported.
If I parse p4 changes, can I add to the change set manually?
Checked again, and it turns out that QB can be forced to report changes between arbitrary change lists. To do it, use below groovy script as pre-execute action of the record changes step:
def startCL = new PerforceRevision(vars.getValue("LastSuccessfulCL"));
def endCL = new PerforceRevision(vars.getValue("LatestCL"));
def repo = repositories.get("repo");
Thanks again Robin! Ultra helpful as always.