Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to create build definition programmatically?

 I want to automate the process of creation of build definition in RTC.

0 votes



3 answers

Permanent link

I suggest that you give some more details about your request, but I have a sample that uses Plain Java API.


import com.ibm.team.build.common.BuildItemFactory;
import com.ibm.team.build.common.builddefinition.BuildConfigurationRegistry;
import com.ibm.team.build.common.builddefinition.IBuildDefinitionTemplate;
// create build definition
IBuildDefinition newbuildDef = BuildItemFactory.createBuildDefinition((com.ibm.team.process.common.IProcessArea) projectArea);

Once you have the IBuildDefinition object, you can set its properties using the BuildItemFactory methods. 

0 votes


Permanent link

 The easiest is to use ANT to create the build definitions.


Here is an example:

<project name="BuildServer"
         xmlns:ld="antlib:com.ibm.team.enterprise.zos.systemdefinition.toolkit"
         xmlns:xt="antlib:com.ibm.team.build.extensions.toolkit">
.......
<xt:updatebuilddefinition buildworkspace="build.mortgage.test"
                          repositoryAddress="${repo.url}"
                          userId="${repo.adminid}"
                          password="${repo.adminpw}"
                          buildid="mortgage.test"
                          processareaname="${jke}"
                          processAreaNameDefinitions="${zproject.name}"
                          updateOnly="true"
                          verbose="true"
                          failOnError="true">
<xt:buildEngineDefine id="zos.my.co" />
</xt:updatebuilddefinition>
........
</project>

0 votes


Permanent link

 The easiest is to use ANT to create the build definitions.


Here is an example:

<project name="BuildServer"
         xmlns:ld="antlib:com.ibm.team.enterprise.zos.systemdefinition.toolkit"
         xmlns:xt="antlib:com.ibm.team.build.extensions.toolkit">
.......
<xt:updatebuilddefinition buildworkspace="build.mortgage.test"
                          repositoryAddress="${repo.url}"
                          userId="${repo.adminid}"
                          password="${repo.adminpw}"
                          buildid="mortgage.test"
                          processareaname="${jke}"
                          processAreaNameDefinitions="${zproject.name}"
                          updateOnly="true"
                          verbose="true"
                          failOnError="true">
<xt:buildEngineDefine id="zos.my.co" />
</xt:updatebuilddefinition>
........
Myloweslife
</project>

Thanks for the update and quick reply. I'll be sure to keep an eye on this thread. Looking for the same issue. the solution worked for me.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,031

Question asked: Aug 25 '21, 4:27 a.m.

Question was seen: 1,063 times

Last updated: Aug 27 '21, 2:50 a.m.

Confirmation Cancel Confirm