Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[closed] 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;

0 votes


The question has been closed for the following reason: "Duplicate Question https://jazz.net/forum/questions/162155/extending-jazz-build-engine-how-to-create-a-workspace-from-tag-and-then-load-that-workspace" by tmok Aug 28 '14, 4:19 p.m.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Aug 28 '14, 12:42 p.m.

Question was seen: 2,273 times

Last updated: Aug 28 '14, 4:19 p.m.

Confirmation Cancel Confirm