如何让BitBucket.org提交以触发TeamCity构建?

时间:2017-12-04 08:45:53

标签: teamcity bitbucket webhooks

如何在BitBucket.org中配置webhook来触发TeamCity构建?

2 个答案:

答案 0 :(得分:1)

使用TeamCity REST API:

  1. 使用Run build权限
  2. 在TeamCity服务器上创建用户
  3. 在BitBucket上创建一个新的webhook到准备好的URL

    http://username:password@teamcity.server.address/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
    
    • usernamepassword替换为您刚刚创建的用户
    • teamcity.server.addressbitbucketusernamerepo替换为您的回购价值,
  4. 有关详细信息,请参阅文档:

答案 1 :(得分:-1)

使用TeamCity REST API:

http://username:password@teamcity.server.address/httpAuth/app/rest/vcs-root-instances/commitHookNotification?locator=vcsRoot(id:My_VCS_ROOT_ID,count:99999)

哪里 My_VCS_ROOT_ID是在TeamCity设置中定义的目标VCS根的ID。

关于Teamcity的文档有点难以阅读,但足够清楚https://confluence.jetbrains.com/display/TCD18/REST+API

相关问题