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

How do I programmatically create a release from a build?

I have both the build system toolkit as well as the Java Client Api. As part of my build I automatically execute a fairly thorough set of build verification tests. Assuming those tests pass, I want to automatically/programmatically create a release from the build, instead of manually doing it from the build results page.

Any ideas on how to do that or pointers to where I could look?

Thanks,

Al

0 votes



One answer

Permanent link
Assuming you have an IBuildResult in hand, you can do something like this.
This is how the RTC UI does it.


IWorkItemClient workItemClient = (IWorkItemClient)
teamRepository.getClientLibrary(IWorkItemClient.class);

IBuildDefinition definition = (IBuildDefinition)
teamRepository.itemManager().fetchCompleteItem(buildResult.getBuildDefinition(),
IItemManager.REFRESH, null);

ITeamAreaHandle teamAreaHandle = definition.getTeamArea();
ITeamArea teamArea = (ITeamArea)
teamRepository.itemManager().fetchCompleteItem(teamAreaHandle,
IItemManager.REFRESH, null);

final IDeliverable deliverable =
workItemClient.createDeliverable(teamArea.getProjectArea(),"name of
release", null);

deliverable.setArtifact(buildResult);
deliverable.setCreationDate(new Timestamp(System.currentTimeMillis()));
deliverable.setName("name of release");
deliverable.setHTMLDescription(XMLString.createFromPlainText(definition.getId()
+ " " + buildResult.getLabel()));
deliverable.setFiltered(false);

workItemClient.saveDeliverable(deliverable, null);


---
Ryan Manwiller
Jazz Team

1 vote

Your answer

Register or log in to post your answer.

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.

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

Question asked: Oct 29 '08, 4:51 p.m.

Question was seen: 5,911 times

Last updated: Oct 29 '08, 4:51 p.m.

Confirmation Cancel Confirm