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

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
Accepted answer

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>>

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

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...

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.

Thanks - You da man!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

211 views 3 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you