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

Can I get the snapshot label from the team.scm.snapshotUUID?

Hi

I want is to store the snapshot created by the build into the final deployment unit, a zip file. What's the best approach to do this? BTW, is there a way to retrieve the item label from its UUID?

Thanks
Jirong


0 votes



2 answers

Permanent link
I'm not sure about storing the snapshot, but regarding getting the label, snapshots are IBaselineSet objects.

First thing is to create a handle based on the UUID:
<pre>IBaselineSetHandle handle = IBaselineSet.ITEM_TYPE.createItemHandle(uuid, null);</pre>

On the client side you can use the item manager to fetch the full item:
<pre>IBaselineSet set = (IBaselineSet)workspaceConnection.teamRepository().itemManager().fetchCompleteItem(handle, IItemManager.DEFAULT, null);
set.getName()</pre>

On the server use the RepositoryItemService
<pre>
IRepositoryItemService service = OsgiServicesManager.INSTANCE.getService(IRepositoryItemService.class, null);
IBaselineSet snapshot = (IBaselineSet) service.fetchItem(handle, IRepositoryItemService.COMPLETE);
</pre>

From the command line, the only thing I can see to do is to list the snapshots and grep for the UUID.  When using the command line you can use <tt>--show-uuid y</tt> (and perhaps also <tt>--show-alias n</tt>) to see the UUIDs.
<pre>
> ./lscm list workspaces -r ella -c aniefer
(1109) "Andrew - Android Stream Workspace" Andrew Niefer
(1110) "Andrew Development Workspace" Andrew Niefer
(1111) "aniefer Workspace" Andrew Niefer
(1112) "aniefer Workspace2" Andrew Niefer

> ./lscm --show-uuid y list snapshots -r ella --maximum 50 1109 | grep _ejqpMLWIEeGOwYY0KAk2eg
(1115:_ejqpMLWIEeGOwYY0KAk2eg) "Test Snapshot 1" Jun 13, 2012 2:49 PM

</pre>

1 vote

Comments

WOW, is there a way to find that using command line or RTC eclipse client?

Thanks Jirong

Sorry, I assumed you were creating an extension of some sort and were working in Java. I added some info on the command line, I don't know how to do it using the client.

What I want to achieve is to embed the RTC snapshot information (or something else from which I can relate the source and binary) into the final deployment unit (war/ear/zip) produced by Maven.

Jazz Maven build definition outputs the following information in a Properties file. I am trying to figure out how to use this team.scm.snapshotUUID. I wish I can have the snapshot label instead of this UUID.

Tue Jun 19 11:43:13 EDT 2012

buildDefinitionId=Maven Build team.scm.workspaceUUID=_WXXnMK8nEeG6XI3ra9ra-A buildLabel=20120619-1143 team.scm.snapshotUUID=_ebRvnLolEeGyEcG77cy6sw


Permanent link
The Eclipse client avoids exposing UUIDs to the user. If you're trying to find that snapshot from the build, it is a snapshot of the build workspace so it will be stored there.

For the zip, snapshots cannot be exported as zip files. You'll have to create a workspace, load the content, and zip it up.

You might want to look into automating this in the build process. Then every build you do will have a zip of what it used.

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: Jun 13 '12, 9:41 a.m.

Question was seen: 5,647 times

Last updated: Jun 19 '12, 12:13 p.m.

Confirmation Cancel Confirm