0
votes

I started trial with Bamboo recently. I ran bamboo server on my personal PC and configure our build server to be a remote agent. Our build environment is in Windows. The build process is carried out via TCL script, which basically executes Windows batch command to build different stuffs. The remote agent execute that TCL script after source code checkout. However, the Windows commands that are suppoesed to execute do not actually execute. For example, if we try to execute msbuild batch command from windows, we will do

exec "cmd << msbuild **.sln"

in the TCL script. The result of this command is 'msbuild' is not recognized as an internal or external command, operable program or batch file. The problem was gone for two builds then re-appear right after.

I tried just simply called the script from CMD on the remote agent and aslo execute the job on my PC(which is the default agent) through Bamboo. The mentioned problem does not occur.

Can anyone tell me if there are some other configurations that I have missed?

Thank you.

1
Tcl exec takes a list as argument, so you might want something different here. Either exec [list cmd /c msbuild **.sln] or something using glob and running msbuild directly. exec [auto_execok msbuild] {*}[glob *.sln].schlenk
@schlenk That's not right; exec takes every word as its own word…Donal Fellows
The problem is not with how we exec batch command from within tcl. As I mentioned, the same script runs by itself pr called by the local server. I showed that as a possible example. It should be a configuration problem I believe.Scrathis

1 Answers

0
votes

Well, your command:

exec "cmd << msbuild **.sln"

That's not going to work (unless you have a program called exactly that, which I think is illegal on Windows; you can't have * in a file name). Instead, you need to invoke it either via cmd or using a direct Tcl style invoke.

Which one will be best? I don't know; try them and find out for yourself.

Invoking via cmd.exe

exec cmd /c msbuild *.sln

Invoking a more Tcl-ish style

exec msbuild {*}[glob *.sln]

(Note that I think ** is always unnecessary as * just means “any number of any character” when expanding a glob. If you're using it to mean “recursive search through a directory structure”, say so and I'll provide code to do it using the find command in the Tcllib fileutil package.)