It's all about the answers!

Ask a question

RTC - Postdeliver - Flow change sets from Stream A to Stream B


Purvesh Kulkarni (1111) | asked Sep 21 '15, 9:49 a.m.
edited May 24 '16, 9:10 p.m. by David Lafreniere (4.8k7)

Hi,

I have tried to follow this article (How to keep your streams flowing smoothly in Rational Team Concert 3.0.1) and allow change sets to be delivered between stream but I am facing errors during the Autodeliver step. I tried to search for solution, but could not find any.

Our goal is to deliver the changes to a Green Stream once build is complete without warning or error.

Build Log looks as follows:
2015-09-21 13:08:02 [Jazz build engine] running on host: XXXXXXXXX
2015-09-21 13:08:02 [Jazz build engine] Should build occur?
2015-09-21 13:08:02 [Jazz build engine] Yes: Always build a user initiated request.
2015-09-21 13:08:03 [Jazz build engine] Invoking pre-build participant "com.ibm.team.build.jazzscm"
2015-09-21 13:08:03 [Jazz build engine] Deleting fetch destination "D:\Directory\BUILD_ENGINE_Workspace" before fetching ...
2015-09-21 13:08:03 [Jazz build engine] Fetching files to fetch destination "D:\Directory\BUILD_ENGINE_Workspace" ...
2015-09-21 13:08:24 [Jazz build engine] Invoking build participant "com.ibm.team.build.ant"
Buildfile: D:\Directory\BUILD_ENGINE_Workspace\Source\XXX\Build_Test.xml

init:
    [mkdir] Created dir: D:\Directory\BUILD_ENGINE_Workspace\Source\XXX\dist

prepare:

compile:

publish:
     [echo] Build Result UUID: _abdjsdjfdudskfd
     [echo] Build Result Requester: RTCBUILDUSER
     [echo] Repository Address: https://repository.url:1234/jazz/

BUILD SUCCESSFUL
Total time: 13 seconds
2015-09-21 13:08:38 [Jazz build engine] Invoking post-build participant "com.ibm.team.build.junit.publishing"
2015-09-21 13:08:38 [Jazz build engine] Invoking post-build participant "com.ibm.team.build.autoDeliver"
2015-09-21 13:08:38 [Jazz build engine] Aborting post-build deliver. A snapshot was not created by the Jazz SCM pre-build participant.

Please can you suggest what is missing in the configuration?

Build.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project name="complexRTCAntBuildExample" default="publish"
 basedir=".">

 <target name="init">
  <!-- Setup build properties -->
  <property name="name" value="helloWorld" />
  <property name="src.dir" value="src" />
  <property name="build.dir" value="bin" />
  <property name="deploy.name" value="${name}.jar" />
  <mkdir dir="dist" />
 </target>

 <target name="prepare" depends="init">
  <!-- Start "prep" RTC activity -->
  <startBuildActivity activityIdProperty="prep"
   label="Preparing directories..." buildResultUUID="${buildResultUUID}"
   repositoryAddress="${repositoryAddress}" userId="RTCBUILDUSER"
   password="PASSWORD" />
  <!-- Create build directory ${build.dir} -->
  <mkdir dir="${build.dir}" />
  <!-- Finish "prep" RTC activity -->
  <completeBuildActivity activityId="${prep}"
   buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}"
   userId="RTCBUILDUSER" password="PASSWORD" />
 </target>

 <target name="clean" depends="init">
  <!-- Start "clean" RTC activity -->
  <startBuildActivity activityIdProperty="clean"
   label="Cleaning directories..." buildResultUUID="${buildResultUUID}"
   repositoryAddress="${repositoryAddress}" userId="RTCBUILDUSER"
   password="PASSWORD" />
  <!-- Delete directory ${build.dir} -->
  <delete dir="${build.dir}" />
  <!-- Finish "clean" RTC activity -->
  <completeBuildActivity activityId="${clean}"
   buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}"
   userId="RTCBUILDUSER" password="PASSWORD" />
 </target>

 <target name="compile" depends="prepare">
  <!-- Start "compile" RTC activity -->
  <startBuildActivity activityIdProperty="compile"
   label="Faking the compile..." buildResultUUID="${buildResultUUID}"
   repositoryAddress="${repositoryAddress}" userId="RTCBUILDUSER"
   password="PASSWORD" />
  <!-- Execute the fake compile (really echo out "hello world!" to a text
   file named output.txt -->
  <exec executable="cmd" output="echo.txt">
   <arg value="/c" />
   <arg value="echo hello world!" />
  </exec>
  <!-- Finish "prep" RTC activity -->
  <completeBuildActivity activityId="${compile}"
   buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}"
   userId="RTCBUILDUSER" password="PASSWORD" />
 </target>

 <target name="publish" depends="compile">
  <!-- Start "publish" RTC activity -->
  <startBuildActivity activityIdProperty="publish"
   label="Publishing txt file back to RTC..." buildResultUUID="${buildResultUUID}"
   repositoryAddress="${repositoryAddress}" userId="RTCBUILDUSER"
   password="PASSWORD" />
  <echo message="Build Result UUID: ${buildResultUUID}" />
  <echo message="Build Result Requester: RTCBUILDUSER" />
  <echo message="Repository Address: ${repositoryAddress}" />

  <!-- Publish file echo.txt to RTC -->
  <artifactFilePublisher repositoryAddress="${repositoryAddress}"
   userId="RTCBUILDUSER" password="PASSWORD" buildResultUUID="${buildResultUUID}"
   filePath="./echo.txt" label="echo.txt" />
  <!-- Start "publish" RTC activity -->
  <completeBuildActivity activityId="${publish}"
   buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}"
   userId="RTCBUILDUSER" password="PASSWORD" />
 </target>

 <!-- Taskdef declarations -->
 <taskdef name="artifactFilePublisher"
  classname="com.ibm.team.build.ant.task.ArtifactFilePublisherTask" />
 <taskdef name="startBuildActivity"
  classname="com.ibm.team.build.ant.task.StartBuildActivityTask" />
 <taskdef name="completeBuildActivity"
  classname="com.ibm.team.build.ant.task.CompleteBuildActivityTask" />

</project>

Accepted answer


permanent link
Chris McGee (50511117) | answered Sep 24 '15, 1:42 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hello,

It seems that an SCM snapshot is not being attached to the build result. This is why the warning message appears and could explain why the deliver is not happening.

There are a couple of common reasons why this might happen.

1) The build is being run as a "Personal Build"
If the build is being invoked manually (ie. not on a schedule) make sure that the personal build checkbox is unchecked in the build request dialog.

2) The build definition doesn't have the Jazz Source Control pre-build participant
You can actually see the "Jazz Source Control" tab in the article but it doesn't really go into detail about that part. It probably assumes that you have that part set up already.

When creating the build definition make sure that this participant is checked in the pre-build page. To add it to an existing build definition you can open it up in the Eclipse client, click on the "Build Definition" menu at the top of the and choose "Edit Configuration..."

The Jazz Source Control page will also need a repository workspace to load the source code and create the snapshot. You'll need to pick one in this page so that it can create a snapshot on it and deliver what's in the snapshot to the target stream.

I hope that this helps,
Chris
David Lafreniere selected this answer as the correct answer

Comments
David Lafreniere commented Oct 01 '15, 9:09 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

I agree with everything Chris wrote.
I happened to see another forum post with a similar build output. See:
https://jazz.net/forum/questions/67998/ant-version-reported-by-the-jazz-build-engine-is-wrong


Purvesh Kulkarni commented Oct 13 '15, 7:16 a.m.

Hi Chris,

Thanks, I realized that I was ordering a personalized build. Trying with a regular build I think the change sets are flowing through. I will verify those again and confirm.

I am also looking for a solution, where I need to prepare a copy of the files that have been modified as part of the accepted/delivered change sets.

So, if Stream A has the code checked in and build is requested on this stream, then post Build when code is delivered to Stream B, I need all the files that are being modified/created within those change sets.

Can you suggest of some method to capture these details? Also, if it is possible to just capture the modified file name, I can work on a solution to copy the individual files.


Chris McGee commented Oct 13 '15, 8:48 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Hi Purvesh,

This should be possible with the SCM CLI's "lscm diff" and "lscm list" sub-commands provided that you know the name or unique ID of the two snapshots for the two builds. In general, the builds will create snapshots that match the name of the build result.

I hope that this helps,
Chris


Purvesh Kulkarni commented Oct 28 '15, 12:07 a.m.

Thanks Chris.

I will try that and let you know if it works (or ask back if it does not :-) )

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.