Can I Use The SVNKit Command Line To Merge Before Building
Answered
I previously had a single server with agents on that server so to merge before building I would save a script on the server and call that from the command line runner.
Unsurprisingly, this turned out to not scale.
Not only did I run into the issue of the file not existing on new servers, but I also ran into the use cases of svn either not being installed or an older version being installed than the version being used by TeamCity to check out the code.
Is it possible to use svnkit (shipped with TeamCity) in a command line runner to merge a few branches before a build?
I need to do
- svn revert
- svn stat
- svn log
- svn merge
Please sign in to leave a comment.
Hello!
You can use SVNKit as a Java library to run svn commands you need as the first step using Command Line or Ant Build Runner.
E.g.
Please refer to https://svn.svnkit.com/repos/svnkit/tags/1.3.1-rc1/www/kb/user-guide-command-line-client.html and https://svn.svnkit.com/repos/svnkit/branches/ssh.ping/www/kb/ant.html for more info about SVNKit.
Please also refer to the List of VCS Checkout Modes to enable Always checkout files on agent mode to have .svn folder on agent.
You can also use Administration | Tools | Install Tool... | Zip Archive to distribute a proper svn client onto your agents.
Thanks. I have done something like that now.
I wanted to use some bash commands to parse the output though so I needed the command line runner to be shell and not Windows batch.
I now have 2 command line runners, one to create the shell script and one to run it using bash (all our servers have git bash installed).
Could I use the Install Tools to install this script instead of creating it with the command line runner like this?
Yes, you may propagate your script on Agents using Administration | Tools | Install Tool... | Zip Archive.
It will be placed into
<Agent home>/tools/directory.You can find more information about it here and here.