It's all about the answers!

Ask a question

Jenkins Plugin - how to deliver the snapshot that is created in the workspace to the stream automatically?


Leonardo Marzo (24964852) | asked Oct 31 '13, 5:38 p.m.
 Hi, 

We are using RTC SCM. We a a build definition and the Jenkins plugin configured to build the code. As you know, every time the build runs, a snapshot is created in the workspace associated with the build definition. 

We need to have that snapshot in the stream rather than in the workspace. Is it possible to deliver the snapshot that is created in the workspace to the stream automatically? 

Is there a better way to do it than using the CLI? 

I´l appreciate your help. 

3 answers



permanent link
Spencer Murata (2.3k115971) | answered Nov 01 '13, 12:34 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
 There is a post-build deliver option in the Hudson build definition that will deliver everything from the workspace to a stream.  I don't if it necessarily is better than the CLI, but it is an option.

~Spencer

Comments
Leonardo Marzo commented Nov 01 '13, 1:29 p.m.

Spencer, as far as I understand, the post-build deliver option replaces the whole stream component with the workspace component. This is not a valid solution since meanwhile the build is running, new change sets may be deliver to the stream, and those change sets would be "removed" by the post-build deliver option from the stream. 


sam detweiler commented Nov 01 '13, 2:05 p.m.

wouldn't that happen regardless?  any changes not processed by this snapshot would be lost if you re-insert the snapshot into the stream.

can u explain why you want to do this?


Leonardo Marzo commented Nov 04 '13, 1:06 p.m.

 What I need is that the created baseline are shown from the Stream's baseline history. Delivering a baseline doesn't replace any not processed change sets. When you deliver a baseline you only make that baseline visible from the Stream. 


permanent link
Paul Coccoli (111) | answered Oct 21 '15, 8:03 a.m.
The only option besides command line that I am aware of is even worse - the GUI.  I don't have the reputation points to upvote this question, but I've been wondering the same thing for years.

It would be great to have a Post-Build option to deliver the snapshot to the stream.  Doing it manually is a pain and error prone, and leaving the snapshot in the build workspace doesn't make sense to me.

permanent link
Oliver Steinbrecher (15156) | answered Apr 26 '17, 12:49 p.m.

Due to the lack of missing support from the Jenkins RTC plugin I managed to do this step with the cmd line client.

I'm using a temporary workspace do deliver the snapshot.

The following groovy code is used to define the jenkins pipeline :

node {
      stage('SCM Deliver')
      {   
         /
            Jenkins job parameters:
            sourceStreamSnapshot :  The RTC snapshot name or UUID of the source stream which should be checked out.
            targetStream  : The RTC name or UUID of the target stream. So the checkout snapshot will be delivered to this given stream
         
/
        
          /
              RTC SCM documentation: 
              https://www.ibm.com/support/knowledgecenter/SSYMRC_5.0.1/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
         
/
          /
              Persisting login details:
              1.  cd /jazz/scmtools/scm
              2.  ./scm login -r https:/your.rtc.com/ccm/ -u builduser -p <PASSWORD> -c
              3.  after this step you should find a repository.xml in the following dir :/home/<user>/.jazz-scm . it contains the encrypted login configuration
         
/
          
          // Build workspace is the temporary workspace
          def buildWorkspace = "JenkinsPostDeliverTempWorkspace${BUILD_NUMBER}"
          // List of the components which should be delivered
          def streamComponentList = "MY_COMP"
          // RTC Url
          def repoUrl = "https:/your.rtc.com/ccm/"
          
          // RTC cmdline path
          def rtcCmd = "/jazz/scmtools/scm"
      
          echo "Create temporary workspace"
          sh "${rtcCmd} create workspace -r ${repoUrl} --snapshot '${sourceStreamSnapshot}' ${buildWorkspace}"
          
          try{
              sh "${rtcCmd} deliver -r ${repoUrl} -C ${streamComponentList} -s '${buildWorkspace}' -t '${targetStream}' -v"
          }catch(Exception e){
              echo ${e}
          }finally{
              sh "${rtcCmd} delete workspace -r ${repoUrl} ${buildWorkspace}"
          }
      }
}

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.