Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get BitBucket.org commits to trigger TeamCity builds?

How does one configure webhooks in BitBucket.org to trigger TeamCity builds?

like image 827
Charlie Avatar asked Dec 04 '17 08:12

Charlie


People also ask

What is TeamCity deployment?

TeamCity provides the Deployment type of build configuration. Build configurations which perform deploying to some environment can be marked with this type: these are usually build configurations that have snapshot or artifact dependencies on the builds whose results they deploy.


1 Answers

Use the TeamCity REST API:

  1. Create a user on your TeamCity server with Run build permission
  2. Create a new webhook on BitBucket to the prepared URL

    http://username:[email protected]/httpAuth/app/rest/vcs-root-instances/commitHookNotification?locator=vcsRoot:(type:jetbrains.git,count:99999),property:(name:url,value:bitbucket.org/bitbucketusername/repo.git,matchType:contains),count:99999
    
    • Replace username,password with the user you just created
    • Replace teamcity.server.address, bitbucketusername and repo with your repo values,

See docs for more information:

  • https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-VCSrootinstancelocator
  • https://confluence.jetbrains.com/display/TCD10/Accessing+Server+by+HTTP
like image 107
Charlie Avatar answered Sep 19 '22 00:09

Charlie