job step working directory vs path to build.xml

using TC 8.1, just downloaded, created my first project and job.   not getting expected behavior.

git repo, connect successfully, created custom checkout rules to put the files in the right folder
+:.=>%teamcity.build.branch%

files are placed in the correct location

set build step working directory to
%teamcity.build.branch%/subfolder

build.xml is located there

so what should be in the path to a build.xml?
. (current folder)
nothing
explict path
explict path AND filename

only explicit path AND filename works

why is this necessary?  if the extract folder is correct and this is an ANT job, the default build file is build.xml.
I can understand the value if you need to over-ride that, but I don't (or shouldn't have to)

5 comments
Comment actions Permalink

and the doc on working directory says it will be the current directory for the build

then ./build.xml or just build.xml, or even nothing should work

is this a bug, or working as designed, or did I miss something?

0
Comment actions Permalink

Hi,

As path to build.xml you should specify absolute or relative to the Build Checkout directory path.

There is the difference between Working Directory and Build Checkout directory. Working directory is the directory set as current for the build process, in other words where build script will be executed. By default, this is the same directory as the Build Checkout Directory. Build Checkout Directory is a directory on the TeamCity agent machine where all of the sources of all builds are checked out into. If you want to change checkout directory go to VCS settings page, select “Show advanced options” > Checkout Directory (checkout rules is not the same). While it is recommended to use Auto checkout mode.

0
Comment actions Permalink

sorry.. I do not understand

1. I have a checkout rule

+:.=>%teamcity.build.branch%

this works correctly

then in the job step

working directory is set the %teamcity.build.branch%

then the path to build .xml is either

./build.xml  - explict current directory, which SHOULD BE the working directory, which is defined AFTER the build.xml location) (a)
or
build.xml   -  implict current directory, which SHOULD BE the working directory, which is defined AFTER the build.xml location) (b)

both these fail.

ONLY %teamcity.build.branch%/build.xml works
but your text said
As path to build.xml you should specify absolute or relative to the Build Checkout directory path.
both the prior two  (a and b) DO specify relative to the checkout directory. +:.=>%teamcity.build.branch% (which is correctly created and the source is in this folder, which was requested as the working directory too)

0
Comment actions Permalink

Checkout rules do not change the Build Checkout directory. When you configure checkout rule, you just specify where to checkout some (or possibly all) specific folders.
As I wrote in previous comment to change Build Checkout directory go to VCS settings page, select “Show advanced options” > Checkout Directory. See attached screenshot.



Attachment(s):
Screen Shot 2014-11-11 at 21.59.28.png
0
Comment actions Permalink

Ok, got it..

bad to use the same terms in different meanings..

checkout rule is 'checkout'

chechkout folder is dangerous.. all builds to there? aka custom workspace
beause it is separate from a vcs root.

working directory should still win for the path to the build file.
(and shouldn't have to be specified twice, once in the folder spec and once on the filename)

0

Please sign in to leave a comment.