It's all about the answers!

Ask a question

How to invoke RTC CLI to create a change set, check-in the file and deliver it to the stream.


anoop mc (74810160213) | asked Sep 26 '17, 4:14 a.m.
retagged Oct 06 '17, 3:53 p.m. by Ken Tessier (84117)

 Hi,


To automate certain custom application, we are looking for a solution using RTC CLI SCM Tool

How to invoke RTC CLI to create a change set, check-in the file and deliver it to the stream. 

Note: From the custom application build we will get a *.jar file against which we need to create a change set in RTC CLI, check in the file and then deliver to the stream.  


4 answers



permanent link
SEC Servizi (97122652) | answered Sep 26 '17, 5:37 a.m.

On your custom application build, after the JAR file creation, you have to execute ordered scm commands as:

  1. login to repository:
    scm login -r https://localhost/ccm -n repo -u ${user} -P ${password}
    
                
  2. load a repository workspace:
    scm load ${workspace} -r l
    
                    
  3. copy the JAR file into sandbox
  4. create change-set (check-in):
    scm checkin project/file.jar
    
                
  5. retrieve the change-set ID:
    scm show status
  6. deliver change-set to stream:
    scm deliver ${cs} -s ${workspace} -t ${stream}
Cheers.


Comments
anoop mc commented Sep 26 '17, 10:08 a.m.

 Thanks a lot for the info - After getting through I shall accept this answer 


anoop mc commented Sep 28 '17, 1:47 a.m. | edited Sep 28 '17, 3:01 a.m.

 Could you please let us know how we can create a workspace using RTC CLI as we dont have the GUI. 


1
SEC Servizi commented Sep 28 '17, 3:24 a.m.

Did you read the help I linked? The answer is there.

Cheers.


anoop mc commented Sep 29 '17, 7:28 a.m.

thanks we were able to follow the below steps.




permanent link
anoop mc (74810160213) | answered Sep 29 '17, 7:28 a.m.

 1. Logged into the SCM repository

2. List the streams which I have access to
3. Created a Workspace.
4. Created a new component.
5. Added a new file (abc.jar) into the component created
6. Performed the checkin activity.
7. Tried to deliver to the target stream.

During deliver activity we are getting a warning saying

Syntax used - ./scm.sh deliver --source userWorkspace  --target "RTC Stream Name"


Process Reports:
  Name: Deliver
  Participant Reports:
    Name: Require Work Items and Comments
      A work item or change request must be associated with the change set.
      At least one of the associated work items must specify that the work is planned for the current iteration.
      At least one of the associated work items must be assigned to you.
Problem running 'deliver':
'Deliver' failed. Preconditions have not been met: A work item or change request must be associated with the change set.
<title></title>


Comments
1
SEC Servizi commented Sep 29 '17, 7:44 a.m.

Deliver operation failed because target stream belongs to a project area where is set a participant operation named "Require Work Items and Comments" which requires a work-item associated to the change-set you are delivering.

Cheers.


anoop mc commented Sep 29 '17, 10:22 a.m.
Is there a way to create new work item then associate it with the change-set via RTC CLI 

    

1
SEC Servizi commented Sep 29 '17, 10:46 a.m.

You can add a work item to a change-set as described on the help page but you cannot create a new work item via SCM tools.

Cheers.


permanent link
anoop mc (74810160213) | answered Oct 02 '17, 5:38 a.m.

Thanks for the info and we could pass the syntax error and run the commands


Now the question comes with respect to change set id. When ever we do a check action a unique change set id will be generated.

How to capture the new change set id automatically.


permanent link
anoop mc (74810160213) | answered Oct 05 '17, 3:20 a.m.

 Below is the list of tested commands.


./scm.sh login -r https://rational:9443/ccm -n NCB_DEVOPS_SCM -u username -P password      (Logging into RTC)

./scm.sh -a y list streams -r https://rational:9443/ccm     (Listing the streams for which you have permission)

./scm.sh create workspace -r https://rational:9443/ccm  userWorkspace1 -s "ABC_DEVOPS_SCM Stream"   (Creating your Workspace)

./scm.sh create component "ledger" "ABC_DEVOPS_SCM Stream" -r https://rational:9443/ccm  (Creating a Component under the stream)
Component (1021) "ledger" successfully created.

./scm.sh add component -r https://rational:9443/ccm userWorkspace1 1021   (Adding this component to your workspace)
Following components successfully added:  (1021) "ledger"

./scm.sh share -r https://rational:9443/ccm  userWorkspace1 1021 ledger.jar  (for testing have created a ledger.jar file locally and added it to the component)
Shared successfully

./scm.sh checkin ledger.jar  (Performed the check in operation)

./scm.sh add wi <change set id> <work item ID>  (Associating a change-set with a work item)

./scm.sh deliver --source userWorkspace1 <component ID> --target "ABC_DEVOPS_SCM Stream"   (finally trying to deliver)

Your answer


Register or to post your answer.