It's all about the answers!

Ask a question

Is there a way to automate the component replacement between streams?

Mangirish Wagle (534) | asked Jul 10 '12, 3:23 a.m.
Here is what I do:-
  1. I have two streams 'Development Stream' and 'Integration Stream' having same components.
  2. Whenever I have to promote the code from Development to Integration, I manually replace each component in Integration stream with that from Development stream build snapshot of the build to be promoted.
  3. Please note that I need to promote code from a given build snapshot and NOT directly from the stream.
  4. Also, not all components are replaced as per our business requirement

So here are my questions:-
  1. Is there any better way to perform this code promotion?
  2. Going forward, is there any way to automate this process as we need to do it periodically?
  3. Is there command line API that I can use from shell scripts to perform this task?


2 answers

permanent link
Ralph Schoon (63.3k33646) | answered Jul 10 '12, 4:45 a.m.
edited Jul 10 '12, 4:57 a.m.
Hi, provides you with a lot of interesting articles around SCM. Interesting in your context could be and and I would like to suggest to look into some of them.

There are several ways how you can do such things. The way I think this was supposed to be done with RTC is to use the flow target, with the snapshot for integration loaded into the repository workspace (you can create a repo worspace from a snapshot), set to the integration stream.

A typical integrator would have set up an integration repository workspace that flows to the development stream (default) and the integration stream. The integrator can, using the pending changes view, replace the content of the repository workspace with the snapshot to integrate and change the flow target to the integration stream.

The pending changes will show you the outgoing changes, including the baselines. You deliver what needs to be delivered. If there are modifications on the integration stream, which can happen if more than one team with separate development streams works against it, this would be the opportunity to accept and integrate them prior to deliver and later deliver the integrated code back to the own development stream.

There might be other ways to do it, and it would be interesting to learn how others do this.

Tim Mok commented Jul 10 '12, 1:41 p.m.

I suggest taking a look at that Ralph posted. The post-build deliver in particular sounds like it would fit your needs.

permanent link
Shashikant Padur (4.2k27) | answered Jul 11 '12, 12:51 a.m.
edited Jul 11 '12, 12:54 a.m.
If you are looking at a command line solution (that can be used in scripts), you could use the following command...
scm workspace replace-components [options] <workspace> <replace-type> <replace> [components...]
  workspace    - The target workspace or stream. To specify the workspace or stream, use its name[@repo], alias, or UUID[@repo].
  replace-type - Type of the item to replace. One of: "workspace", "stream", or "snapshot"
  replace      - Item to replace (must be of type specified in replace-type) name[@repo], alias or UUID[@repo].
  components   - Components to replace from the workspace, stream or snapshot (name, alias or UUID)

For ex: lscm workspace replace-components "Integration Stream name" snapshot "Development stream build snapshot name" "Comp1" "Comp2" -r https://Your_repository_Uri

Mangirish Wagle commented Jul 12 '12, 1:31 a.m.

This solution is more like what I wanted... Thanks Shashikant!

Your answer

Register or 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.