0

I'm trying to write a hook that must trigger the CI feature of Visual Studio Online to deploy on Azure whenever a branch is created on Visual Studio Online repository for example:

Master
|--release_1_1_0
|
|--release_12_50_5
|
|--release_17_1_2
|--release_20_1_3
|

In this scenario release_20_1_3 is the least created branch and it should be the one being deployed. Currently I'm trying to code a post commit hook that will get a list of all branches then will get the latest one using the release numbering. If there is a better way or some feature of GIT that will make this easier please help me out.

Alternative solutions are welcome if hooks are not the answer but I have to use GIT on Visual Studio Online and deploy to Azure.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
user3261119
  • 27
  • 1
  • 7

1 Answers1

0

There is a easier way for CI on VSO than using git-hooks. You can easily use the build tab on Visual Studio Online. Create a new build definition (not XAML definition). Setup the build steps and then configure the triggers

Creating Triggers

As you can see in the image above I have created a CI-trigger that triggers at every push on the master branch.

You can easily configure that triggering is done only for release branches by specifying:

Filters: Include: release_

Michael Mairegger
  • 6,833
  • 28
  • 41
  • It would trigger on each push, and use the head of the checked in branch. So if you create the branch with ascending version number, then there should be no problem for using the pushed branch. The only thing you have to be aware is that once pushed a newer version-branch you should not push any older version-branch because then a new build is triggered. – Michael Mairegger Oct 13 '15 at 07:56