Modify an existing RTC Build Result in Jenkins
I'm implementing a prototype of a Delivery Pipeline using RTC and Jenkins with the following flow:
Then, the last stage fails because of the following:
So, is there any workaround to modify the Build Result or, at least, keep it open when the 1st stage finishes until the last stage completes it by itself?
- Stage: Team Concert plugin fetches the source and allocate it in a dynamically assigned workspace.
- Stage: Our custom plugin for Jenkins builds the source fetched above.
- Stage: Few tests are executed and reports, artifacts and logs are published to the Build Result via RTC ANT tasks.
Then, the last stage fails because of the following:
I assume it happens because the same Team Concert plugin that generated the RTCBuildResultUUID (build triggered by Jenkins) reports the result back to RTC and completes it automatically. Therefore, the last stage isn't able to modify it anymore.BUILD FAILED C:\Jenkins\pipeline\build_5\publisher_2014-10-07_17-14-07:4: com.ibm.team.build.common.TeamBuildStateException: Unable to "start" build activity with label "Publishing" because the build with ID "_8Aa-sU4zEeSmjKA9BakEKQ", build definition ID "Pipeline BD", label "#5" is in the "COMPLETED" state.
So, is there any workaround to modify the Build Result or, at least, keep it open when the 1st stage finishes until the last stage completes it by itself?
Accepted answer
There is a 1 to 1 mapping between a Jenkins build and an RTC Build result. It looks based on the article that you are setting up several builds which are triggered after the first build completes. When the first build completes the RTC Build result associated with it will be marked as completed (the plugin will do it if the build is initiated within Jenkins, RTC's integration will do it if the build was initiated within RTC). If a triggered build then tries to create an activity on the RTC build result, it will fail because the RTC build result is already completed.
As Ralph says some things can be done after the build is completed, but creating an activity is not one of them (its like trying to say the build is starting this work, when its already finished so how can it start something).
Unfortunately I have no ideas on how to keep the result open. Only thing I can think of is to create and manage the lifecycle of a build result in your jobs.
As Ralph says some things can be done after the build is completed, but creating an activity is not one of them (its like trying to say the build is starting this work, when its already finished so how can it start something).
Unfortunately I have no ideas on how to keep the result open. Only thing I can think of is to create and manage the lifecycle of a build result in your jobs.
Comments
One other answer
Rafael,
I am not sure what goes wrong and I have no setup to even begin probing. However I did publish to completed builds and worked with them. See https://jazz.net/library/article/807 . So in general it is possible to do something with the builds after they are completed. You can also still link work items for example.
I am wondering if the fact that the build is marked as completed in RTC before the Jenkins steps are performed is really caused by a problem with the setup. I think Jenkins is really leading the build and should actually close it, not the JBE.
I am not sure what goes wrong and I have no setup to even begin probing. However I did publish to completed builds and worked with them. See https://jazz.net/library/article/807 . So in general it is possible to do something with the builds after they are completed. You can also still link work items for example.
I am wondering if the fact that the build is marked as completed in RTC before the Jenkins steps are performed is really caused by a problem with the setup. I think Jenkins is really leading the build and should actually close it, not the JBE.