Extending Jazz Build Engine - How to create a workspace from tag and then load that workspace
I am working on a preBuildParticipant that will, take a builddefinitionid and label, get the asociated snapshot, create a repository worksapce and then load that workspace.
I have managed to get a snapshot as a "IBaselineSet". From here, I am unsure how I will actually create a workspace. I have tried to use the createWorkspaceFromBaselineSet in the IScmService, with no joy.
Code as follows (where getSnapshot is my method):
IBaselineSet snapshot = getSnapshot(buildClient, buildResult,
monitor, repo);
getBuildLog().println("creating workspace manager");
WorkspaceManager workspaceManager = (WorkspaceManager) SCMPlatform.getWorkspaceManager(repo);
getBuildLog().println("creating contributionHandler");
IContributorHandle contributorHandle = (IContributorHandle) IContributor.ITEM_TYPE.createItemHandle(snapshot.getItemId(),null);
getBuildLog().println("creating scm service");
IScmService service = workspaceManager.getServerConfigurationService();
getBuildLog().println("creating baselinesethandle");
IBaselineSetHandle baselineSetHandle = (IBaselineSetHandle) IBaselineSet.ITEM_TYPE.createItemHandle(snapshot.getItemId(),null);
getBuildLog().println("executing create workspace");
WorkspaceRefreshResult result = service.createWorkspaceFromBaselineSet(contributorHandle, snapshot.getName() + "_test!!!!",
"test", baselineSetHandle,IRepositoryProgressMonitor.ITEM_FACTORY.createItem(monitor));
//checkoutSnapshot(snapshot);
return BuildStatus.OK;
|
Be the first one to answer this question!
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.