Passing parameters to command line runner


I am using finalbuilder to execute the actual build for my projects. However, I will need to pass parameters to this. One of these will be the working directory of a project for the code I check-in (Which will be under source ctrl in Perforce), or pass in the source ctrl location root of the project. How could I do this?


Comment actions Permalink


Usually builds are performed on TeamCity agents. When you create a build configuration, you specify VCS roots - where to get sources, and build steps - what actions to do.
At start of a build the agent checks out sources from VCS to a local work folder, and then launches all build steps step-by-step.
So, sources are available to build runners right in current working directory.

But I see FinalBuilder is a standalone build server. What kind of integration with TeamCity do you want to achieve?


Comment actions Permalink

Hi Micheal,

Just a bit of background: I want to use Finalbuilder as I was using TFS 2010 and have scrapped that now (for a number of reasons). Finalbuilder is very easy to use and setup a complex build in (e.g. loops etc).

Finalbuilder allowed me to get build parameters from TFS 2010 (things like build type - debug/release, working directory, team project name, etc). Probably the most important is the working directory, and then from that, Finalbuilder has a very useful action where I can iterate every project in the solution.

So I need to be able to pass to Finalbuilder the working directory, as a string. With that, I can append an additional string which would be the solution file (my solution structure across projects are standardised). I'm not sure if Teamcity can get things like the build type (Visual Studio's) like debug/release? Things like that I may hardcode.

Comment actions Permalink


A bit of learning has revealed that:

Is the directory the source gets checked out to. I need to pass this to the build.

In the build step, where I configured the command line runner, I pass this as a parameter. Is this the right thing to do?

However, there is a seperate page called Build Parameters. Would I need to use this?

Comment actions Permalink

I'm sorry for late reply.

By default your build script is started right within checkout directory. So checkout directory is equal to the current directory, until Working directory setting is defined in build runner configuration.

There is a set of predefined build parameters that are defined automatically, and can be referenced inside your build scripts.
In your case it's

System Property Name Environment Variable Name Description none

Checkout directory used for the build.

Do not rely on, it's internal property and we're going to hide it from UI.

Due to OS limitations not all of the parameters are exposed as environment variables. For checkoutDir you'll need to explicitly add it to the list.
Build parameters tab is the place where additional variables can be introduced. For example:



Please sign in to leave a comment.