programmaticallypromoting a snapshot
I would like to programmatically promote a good build snapshot from the build workspace to the default flow target (a stream). I have IWorkspaceConnection objects to both the build workspace and the stream and I can remove the IBaselineSet from the build workspace with:
However a cannot add the IBaselineSet to the stream with:
Is this the correct way to do a snapshot promotion? Why am I not able to see a snapshot added to a stream with the addBaselineSet method? |
6 answers
That should work just fine. You don't even need to remove the snapshot first -- it can be associated with multiple workspaces/streams.
The Promote action in the Search view when you Show Snapshots is implemented this way. What error, if any, are you getting? |
That should work just fine. You don't even need to remove the snapshot first -- it can be associated with multiple workspaces/streams. I actually figured out that I didn't need to make the call to remove and I only needed to do an add. Thanks for your help! |
I had a request for a code snippet on how this was actually accomplished. Note that this snippet is from a task that extends the AbstractTeamBuildTask class.
|
This can also be done using the SCM command line (under scmtools in the RTC eclipse client install).
./scm.sh help snapshot promote Help on snapshot promote Promote snapshots to a workspace or stream. This will associate the snapshots with the workspace or stream. Aliases: pr Usage: scm snapshot promote <workspace> <snapshots> workspace - Workspace or stream where the snapshots are promoted to. snapshots - Snapshots to be promoted to the workspace or stream. Options: -P arg - Password for repository. -r arg - URI specifying the location of repository. -u arg - Username for repository. |
Can you tell me what scm version you are using? I'm seeing:
Unknown subcommand "snapshot" Here's my version: /build/tools/IBM/TeamConcert/scmtools/eclipse/scm version com.ibm.team.filesystem.cli.tools, version 2.0.2.I200910232005 Subcommands: tools.verify tools.validate tools.echo.stdin tools.configvalue com.ibm.team.filesystem.cli.client, version 2.0.2.I200912072036 Subcommands: load login logout create create/workspace create/baseline create/changeset create/snapshot create/component changeset changeset/comment changeset/close changeset/relocate changeset/associate changeset/disassociate changeset/suspend changeset/resume daemon daemon/start daemon/stop change-target change-target/workspace change-target/component list list/workspaces list/projectareas list/teamareas list/streams list/components list/remotefiles list/credentials list/daemons list/snapshots list/locks list/properties checkin accept deliver status conflicts resolve move lastmod share discard undo compare history diff repair workspace workspace/add-components workspace/remove-components workspace/replace-components property property/list property/get property/set lock lock/list lock/acquire lock/release annotate com.ibm.team.filesystem.cli.core, version 2.0.2.I200912032141 Subcommands: help version |
Can you tell me what scm version you are using? I'm seeing: From Nick: It was only added in 3.0 M4: Want a promote snapshot for CLI (84638) However, you should be able to use the 3.0 M4 SCM CLI against a 2.0.0.x server. 3.0 M5 has version compatibility issues though. |
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.