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

link between a snapshot and a build result

Hello,

i would like to know if it's possible to programmatically create a link between a build result and a snaphshot in RTC. In order to access the SNAPSHOT from the build result in the dashboard.

Furthermore, if i understand the documentation correctly, a build result can be created by building my app via the RTC build engine. Is it the only one way to create it ?
Is it possible to programmatically create a build result, no matter if it's through Java or REST API.

Regards,

Vincent

0 votes

Comments

Also wondering the same... 



2 answers

Permanent link
I'm not on the build team so I'm not 100% sure but the javadoc that goes with the plain java client libraries seems to indicate that this is possible.

You can look at the LinkPublisherTask that can publish a link in your build result. You can use this to link to various artifacts, including a snapshot.

It also looks like you can create a build result. I'm guessing that if you do this, you'll have to control the entire flow of states that the build goes through (somebody correct me if I'm wrong). You should take a look at ITeamBuildRequestClient to get started requesting a build. If you have any specific questions on its usage, open up a new question.

0 votes


Permanent link
Wow, sorry the original question went unanswered for so long.  Yes it's possible to do via Java API, both creating a build result and associating a snapshot.  For some examples of using the API, see https://jazz.net/wiki/bin/view/Main/BuildFAQ#Is_there_a_programmatic_API_for

It's also possible to do via the Ant tasks, i.e. the startTeamBuild, teamAccept tasks (the latter does the SCM accept then creates a snapshot, which may be more than you want).  Using the linkPublisher Ant task that Tim mentioned is another option, but note that the snapshot will appear as an external link then, which is not the way a snapshot contribution is normally represented.

Before getting into API specifics, it would help to know more about your scenario, in case we can recommend another solution.

0 votes

Comments

Hi Nick.  We're looking to duplicate a build result from buildA to buildB, a process which we plan to use after promoting from one stream to another as part of a proposed continuous integration model.  I have logic to move the build result working, but ideally we'd like to duplicate it under buildB.  Currently I've created a build result, marked it complete, and set all the set-able properties based on values from the build result as it exists in buildA.  However, I'm having trouble associating a snapshot/baseline with the result.


Apologies to Vincent for hijacking his thread - I can open a new question if you prefer.

Any insight as to why this doesn't work?  The log array is populated as expected....buildResultWC is a working copy of a build result.


IBuildResultContribution[] logs = repo.getTeamBuildClient().getBuildResultContributions((IBuildResultHandle)brToCopy.getIBuildResult().getItemHandle(), IBuildResultContribution.LOG_EXTENDED_CONTRIBUTION_ID, repo.getMonitor());
repo.getTeamBuildClient().addBuildResultContributions((IBuildResultHandle) buildResultWC.getItemHandle(), logs, repo.getMonitor());

Error is:
Save Build Result
Unable to login: !ContentStorage.attributeDoesNotMatch! 

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
× 12,019
× 1,202
× 562

Question asked: Feb 09 '11, 8:32 a.m.

Question was seen: 6,816 times

Last updated: Aug 14 '13, 12:56 p.m.

Confirmation Cancel Confirm