automated build configuration copy

On my team our process for working on issues is to create a private branch off the trunk, do all the work on that private branch, and then promote those changes back to the trunk after the code is complete and has been code read (we use the savana tool for this, http://savana.codehaus.org/).

I would like to write a tool or plugin that copies a build configuration and just modifies the vcs root to now point to a new svn root directory. I know this can be done through the admin tab in team city, but ideally I'd like to write a plugin so that I can script this; it's such a common part of our workflow that having to manually copy a build configuration each time you start work on a new task is a big pain.

Can someone let me know if this is possible and if so where I can find some pointers on how to do this? I'm relatively new to TeamCity so any help would be greatly appreciated.

Thanks

1 comment

Hello,

To create a copy of build configuration in plugin do the following:
- locate original build configuration using ProjectManager.findBuildTypeById
or SProject.findBuildTypeByName
- call method SProject.createBuildType which accepts buildType as its first
argument with original buildType, it will create a copy of buildType
- call SProject.persist() to persist new build configuration on disk

Then you can modify build configuration VCS roots: see method
SBuildType.getVcsRoots()
VcsRoot settings are stored in a map, so you should know name of the
property you want to modify. Use VcsRootsUpdate.updateVcsRoot() method to
update VCS root. After modification VCS root must be persisted too, see
VcsRootsUpdate.persistVcsRoots() method.

Hope this helps.

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Alex Devine" <alex_devine_98@post.harvard.edu> wrote in message
news:28434376.1204047594154.JavaMail.itn@is.intellij.net...

On my team our process for working on issues is to create a private branch
off the trunk, do all the work on that private branch, and then promote
those changes back to the trunk after the code is complete and has been
code read (we use the savana tool for this, http://savana.codehaus.org/).

>

I would like to write a tool or plugin that copies a build configuration
and just modifies the vcs root to now point to a new svn root directory. I
know this can be done through the admin tab in team city, but ideally I'd
like to write a plugin so that I can script this; it's such a common part
of our workflow that having to manually copy a build configuration each
time you start work on a new task is a big pain.

>

Can someone let me know if this is possible and if so where I can find
some pointers on how to do this? I'm relatively new to TeamCity so any
help would be greatly appreciated.

>

Thanks



0

Please sign in to leave a comment.