It's all about the answers!

Ask a question

Can I create a snapshot using an alias from the command line?


Eddie Breeveld (6112530) | asked Jan 24 '14, 3:40 p.m.
retagged Feb 04 '14, 6:28 p.m. by Sonia Dimitrov (27159)
From the command line in RTC 4.0.4 in a Windows batch can I create a snapshot using an alias?
For instance this does not work:
scm login -r https://site:port/ccm -n RTC_ALIAS -u User -P %BuildSvcPass% -c
scm create snapshot RTC_ALIAS
The login succeeds, but the create snapshot doesn't.  It may be that I've misunderstood the syntax, what have I got wrong!?

3 answers



permanent link
Eddie Breeveld (6112530) | answered Feb 04 '14, 11:13 a.m.
By trial and error I found an answer, thanks also to both who replied with suggestions:
scm login -r https://site:port/ccm -n RTC_ALIAS -u User -P %BuildSvcPass% -c
scm create snapshot -r https://site:port/ccm "workspace_name"
It 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.

Comments
Karthik N V S commented Feb 04 '14, 11:35 a.m.
JAZZ DEVELOPER

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


permanent link
Dejan Custic (2855) | answered Jan 31 '14, 2:12 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
The related Help topic is here http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0m4/topic/com.ibm.team.scm.doc/topics/create_snapshot.html

permanent link
Karthik N V S (563) | answered Jan 25 '14, 2:02 a.m.
JAZZ DEVELOPER
Snapshot could be created using the alias.

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
Eddie Breeveld commented Jan 27 '14, 3:46 a.m.

Thanks Karthik.  Does this mean that the login alias in my command line example is incorrect?  How do I get a 'repository workspace' alias?


Karthik N V S commented Jan 27 '14, 4:06 a.m.
JAZZ DEVELOPER

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.


Eddie Breeveld commented Jan 27 '14, 4:12 a.m.

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?


Karthik N V S commented Jan 27 '14, 4:57 a.m.
JAZZ DEVELOPER

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


Eddie Breeveld commented Jan 27 '14, 5:35 a.m.

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?


Karthik N V S commented Jan 27 '14, 6:05 a.m.
JAZZ DEVELOPER

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.


Karthik N V S commented Jan 28 '14, 3:14 a.m.
JAZZ DEVELOPER

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.




 

showing 5 of 7 show 2 more comments

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.