Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to use Subversion hooks with Bamboo on Windows Server 2008?

Richard Wilder April 26, 2012

Here's my setup: Bamboo 3.4.3 on Windows Server 2008 R2 also with VisualSVN 2.5.1. Everything is installed and working (once I learned it is required to run Bamboo as a service under an account other than SYSTEM).

Now I would like to trigger plan builds whenever code is committed to SVN. I understand generally how post-commit hook is supposed to work - except this is a Windows machine and it doesn't run the bash shell scripts that Bamboo provides. (At least I don't know how to make it do so...)

A) Do I need to install Cygwin or Mingw/MSYS?

B) Do I need to re-write the provided scripts in Windows *.bat (or *.vbs or *.ps1 or ?) form?

C) Has someone already done so? Certainly every other Atlassian customer who uses Windows has the same issue...

Thanks in advance for your help...

Dick

1 answer

1 accepted

2 votes
Answer accepted
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2012

As per the documentation here, VisualSVN on windows expects anything that is executable on windows, which means, either .exe or .bat.

And again as per Bamboo documentation, you need to change the scripts to suit Windows.

So in a nut-shell, you need to do the following

  1. create a file called post-commit.bat under hooks directory in your repo
  2. download the wget binary for windows from here and put in a path accessible in that visualsvn server, or add to PATH variable
  3. Inside the post-commit.bat call
    wget <<bamboobaseurl>>/api/rest/updateAndBuild.action?buildKey=<<build-key>>

Richard Wilder April 26, 2012

Thank you Renjith.

I have read the manuals you reference - which weren't as helpful as your excellent comments #2 and #3. What the Bamboo documentation is missing is that wget is available for windows (if you download it). It also is missing the format of the wget call.

BTW: The link to wget binary didn't come through - but I'll google it.

Thanks again,

Dick

Richard Wilder April 26, 2012

Wow. Lot's of options for windows flavors of wget. Which one did you recommend? I'd rather not have to install all of Cygwin or MinGW if there's a single *.exe...

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2012

Guess this should work

http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe

Once installed (better to install in a path without spaces), either add the installed bin path to PATH variable or directly use the full path in the hook script.

Richard Wilder April 26, 2012

Thanks - You da man!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events