Can I create a snapshot using an alias from the command line?
For instance this does not work:
scm login -r https://site:port/ccm -n RTC_ALIAS -u User -P %BuildSvcPass% -cThe login succeeds, but the create snapshot doesn't. It may be that I've misunderstood the syntax, what have I got wrong!?
scm create snapshot RTC_ALIAS
3 answers
scm login -r https://site:port/ccm -n RTC_ALIAS -u User -P %BuildSvcPass% -cIt was not clear why I need to specify the URI again even though I have already logged on! Other switches can be added to give the snapshot a name and description.
scm create snapshot -r https://site:port/ccm "workspace_name"
Comments
At any point of time, you could be logged into multiple repositories. And, different repositories may have workspaces by the same name. So, URI is required.
Here is an example to give name to a snapshot
scm create snapshot -r https://site:port/ccm "workspace_name" -n snapshot_name
scm create snapshot ALIAS
Here, the ALIAS of the repository workspace should be specified.
In RTC 4.0.5, the syntax is
scm create snapshot -- ALIAS
Here, the ALIAS of the repository workspace should be specified..
Comments
Thanks Karthik. Does this mean that the login alias in my command line example is incorrect? How do I get a 'repository workspace' alias?
Run the following command from within the sandbox.
scm status
The result of the above command would look like
Workspace: (1000) "TestWorkspace" <-> (1001) "Stream"
Component: (1002) "abc1"
....
Here, 1000 is the alias of the repository workspace.
Now,
scm create snapshot 1000
would create the snapshot.
Thanks again. Unfortunately I am running this from a windows batch command, not the command line. I do not have a command output interpreter available. Can a snapshot be created using only information available from within a Windows batch?
Snapshot could be created if the name or uuid of repository workspace is known.
It could be done in the following way:
scm create snapshot name(or uuid) -r repository-uri
I'm sorry I am very new to RTC. Do you have a working example please? What does the 'name' look like? As this is part of the nightly build process, should I be taking a snapshot of the stream?
The 'name' is the name of the repository workspace. It is the name which is specified by the user while creating the repository workspace.
A snapshot could be created for a repository workspace.
Taking the same example given above,
scm status
The result of the above command would look like
Workspace: (1000) "TestWorkspace" <-> (1001) "Stream"
Component: (1002) "abc1"
....
Now, a stream could be created for "TestWorkspace" using (eg)
scm create snapshot TestWorkspace -r https://site:port/ccm
No need to run the status command if the name of workspace is known.
I'm sorry. In the above comment what I meant was
A snapshot could be created for "TestWorkspace" using scm create snapshot but not stream.