![]() When the build completes, the status is posted back to VSTS, allowing the pull request to be completed by merging the changes into master. With all that configuration done, creating a new pull request in VSTS should now trigger a branch build in TeamCity. This effectively seems to allow one of the VCS roots to continue using its default/master, while allowing other options for the 2nd root. In the build configuration VCS Trigger, set the Branch filter to +: So, despite TeamCity mentioning 'logical branch name' for the 'Branch Filter' in Version Control Settings, can actually provide full branch name. We don’t need TeamCity to trigger the builds for the pull request branches as the pull request server will be queuing those builds, but we do still want TeamCity to trigger the master builds. In the VCS Root settings for the VSTS Git repository, set Branch Specification to +:refs/heads/(master) Clear all the trigger events except On Completion Trigger when build successful and Trigger when build fails.Set the payload format to Legacy webhook (JSON).If the pull request server is hosted at, you would use. Branch Filter Format To filter branches, use a newline-delimited list of +-:logicalbranchname rules, where logicalbranchname is the name displayed in the TeamCity UI (for example, master ). In the URL, enter the URL that TeamCity will use to connect to the pull request server.Įg. If specified, a branch filter in the settings of a build trigger applies to the subset declared by the filter (2).Click on add build Webhooks, then Click to create new WebHook for this build and add a new web hook for the project.With that in place, go to the build configuration page in TeamCity, and you’ll see a new WebHooks tab. To allow TeamCity to call the pull request server, you will need to install the Web Hooks plugin for TeamCity. The Add status policy button should be enabled, and clicking on that you should be able to find the pull request server listed in the drop down. With the service hooks in place, you can now go to the Branches page, and click on the … (more actions) icon and choose Branch policies. Repeat these steps to create another service hook for Pull request updated, also setting the Change filter to Source branch updated.Click on Finish to save this service hook.Set Messages to send and Detailed messages to send to None.In Username and Password, enter the credentials that will be used to authenticate with TeamCity.If the pull request server is hosted at and the TeamCity build type id is My_CI_Build then you’d use In URL, enter the URL that VSTS will use to connect to the pull request server, including a query string that defines which TeamCity build should be queued.Įg.If appropriate, select a specific repository and click Next.Go to the Service Hooks tab for your project.If you followed the steps in the sample tutorial, this will be familiar. Now that we’ve created the pull request server, we need to configure VSTS and TeamCity so that they can send event messages to it. Part 3 in a series on integrating VSTS with TeamCity
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |