It's all about the answers!

Ask a question

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

Jirong Hu (1.5k6263256) | asked Jun 13 '12, 9:41 a.m.
retagged Jun 15 '12, 1:31 p.m. by Evan Hughes (2.4k1018)

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?


2 answers

permanent link
Andrew Niefer (6385) | answered Jun 13 '12, 11:08 a.m.
edited Jun 13 '12, 2:56 p.m.
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);

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

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.
> ./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


Jirong Hu commented Jun 13 '12, 2:11 p.m.

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

Thanks Jirong

Andrew Niefer commented Jun 13 '12, 2:58 p.m.

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.

Jirong Hu commented Jun 19 '12, 12:13 p.m.

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
Tim Mok (6.6k38) | answered Jun 15 '12, 11:45 a.m.
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.

Your answer

Register or to post your answer.