Search code examples
bitbucketazure-pipelineseventtrigger

Build in VSTS should start when code is pushed to Bitbucket


I am using VSTS as my CI server and BitBucket as SCM tool. Now, what I want is really simple. Once any changes are pushed into BitBucket, I require the build to be triggered in VSTS. Is there anyway we can achieve this?

Appreciate any help.


Solution

  • There must have polling interval time to trigger VSTS build after pushing changes to your bitbucket repo. The shortest polling interval time is 60 seconds. That means the CI build will be triggered 1 minute later after pushing changes.

    Detail settings for bitbucket repo CI build in VSTS as below:

    Create a build definition in VSTS

    • select Remote repo in Get sources step
    • add connection for bitbucket repo
    • input bitbucket repo URL as Server Url
    • input bitbucket username and password
    • Ok
    • in Triggers Tab of VSTS build
    • enable Continuous Integration
    • set Polling interval (such as 60)
    • specify the branch for CI build on Branch Filters
    • add tasks you need to build
    • save.

    enter image description here

    Now when new changes are pushed to bitbucket repo, the VSTS build will be queued 1 minute later.