It's all about the answers!

Ask a question

Is there a extension point for CMD Line Rational Build Agent Build Def


Steve White (4021213) | asked Jul 16 '13, 10:26 a.m.
Using a JBE build Def I can extend it and add my custom properties(generic) which are hidden from the user. The values are created dynamically during Request Build dialog processing.
I'm attempting to use the cmdline Build Agent vs a JBE, but I do not see a way to extend the Build def as with the JBE so I can define generic properties.
For JBE I use the following:
<plugin>
   <extension
         point="com.ibm.team.build.common.buildConfigurationElements">
      <buildConfigurationElement
            id="com.ibm.sdwb.zbuild.rtc.common.library.definition" buildPhase="BUILD"
            description= "Configuration for a zBuild using the Cmd Line Build Agent"
            name="zBuildLibrary">
              <genericProperty
                       genericEditAllowed="false"
                       name="com.ibm.sdwb.zbuild.rtc.common.host.server"
                       description="Hostname"
                       required="false"
                       defaultValue=""/>
     </buildConfigurationElement>
   </extension>
   <extension
         point="com.ibm.team.build.common.buildDefinitionTemplates">
      <buildDefinitionTemplate
            id="com.ibm.sdwb.zbuild.rtc.common.library.definitions"
            name="zBuild - Library">
         <buildConfigurationElement id="com.ibm.team.build.general"/>
         <buildConfigurationElement id="com.ibm.team.build.schedule"/>
         <buildConfigurationElement id="com.ibm.team.build.properties"/>
         <buildConfigurationElement id="com.ibm.sdwb.zbuild.rtc.common.library.definition"/>
      </buildDefinitionTemplate>
   </extension>

I can add the build agent cmdline tab via          <buildConfigurationElement id="com.ibm.rational.buildforge.buildagent.cmdline"/>
BUT because the extension is for a JBE it will not be accepted for a Build Agent Engine. An error is indicated when you attempt to associate the build def with the engine, which makes sense.

So is there a similar extension point for the Build Agent? Or is there another way to programatically add properties to the Build def during Request Build...

Regards,
-Steve

Comments
Steve White commented Jul 16 '13, 10:43 a.m.

P.S. I don't really need to define a custom Build Def. I just need to be able to pass custom properties/configuration data to the Build Agent in the Build Request. An alternate solution in JBE is to define configuration properties. Is there an equivalent of this for the Build agent?

<extension
         point="com.ibm.team.build.common.buildConfigurationElements">
      <buildConfigurationElement
         id="com.ibm.team.build.ant" buildPhase="BUILD"
         description="Configuration for an Ant-based build using the Jazz Build Engine."
         name="Ant">
         <configurationProperty name="com.ibm.team.build.ant.buildFile"/>
       <configurationProperty name="com.ibm.team.build.ant.workingDir"/>
         <configurationProperty name="com.ibm.team.build.ant.propertiesFile"/>
         <configurationProperty name="com.ibm.team.build.ant.includeToolkit" defaultValue="true"/>
         <configurationProperty name="com.ibm.team.build.engine.variable.substitution"/>
      </buildConfigurationElement>
   </extension>


Steve White commented Jul 16 '13, 11:18 a.m.

P.S. defining configuration properties may be a possible solution to want I want to accomplish. I was able to define them and programmatically set their value within the Build Request dialog. I have a custom section defined to handle this via applyProperties().
The question I have for this solution is how do I access the configuration property form winin a ANT script running on the Build Agent ( The engine cmd is ANT). I don't see the configuration props listed in the log as a env as properties are listed.
This is what I defined in the plugin.xml:
<extension
         point="com.ibm.team.build.common.buildConfigurationElements">
      <buildConfigurationElement
         id="com.ibm.rational.buildforge.buildagent.cmdline" buildPhase="BUILD"
         name="AgentCmdLine">
         <configurationProperty name="zbuildRequest"/>


Steve White commented Jul 16 '13, 4:19 p.m.

I believe I found a solution to my problem. Basically I want to be able to pass Build specific data to the build agent, but have it hidden from the user. I was able to set a property programmatically in the build def that was not predefined from within my applyProperties().
      buildDefinition.setProperty( "zbuildUserId", "TESTID" );
I was then able to retrieve it in the ANT script running on the agent server via
<echo message="zbuildUserId=${env.zbuildUserId}"/>
The property will show in a Rebuild Request, which I rather it didn't, but I do need the value in the Rebuild Request. So this looks like it will at least do what I need, but if there are better solutions I'd appreciate them.


One answer



permanent link
Surya Tripathi (65017) | answered Jul 18 '13, 4:05 p.m.
See the last comment from the submitter.

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.