Building From On-Premises Bitbucket Server Using Visual Studio Team Services

I was recently asked via Twitter if you could build from an on-premises Bitbucket server using Visual Studio Team Services.  The answer is yes and this post will show you how.

The only assumption I am making is you already have an on-premises Bitbucket server that is exposed to the internet.  This post is going to focus on establishing a connection to an on-premises Bitbucket server and not the project being built.

image_thumb4
  1. Log in to Team Services
  2. Click the Build hub
  3. Click the green plus 
  4. Select the Empty template
  5. Click Next
  6. Select Remote Git Repository
  7. Check the box for Continuous integration
  8. Click Create

With the build created, it is now time to connect Bitbucket to Team Services.

image
  1. Click the Repository tab
  2. Click Manage next to Connection
  3. Click New Service Endpoint
  4. Select External Git
    Field Value
    Connection Name Bitbucket
    Server URL http://{Bitbucket Server}:{Port}/scm/{Project}/{Repo}.git
    User Name [Username with permissions to repo]
    Password/Token Key [Password for user]
  5. Close tab
  6. Click Refresh button next to Manage
    Field Value
    Repository type External Git
    Connection Bitbucket
    Repository name [Leave empty, the system will fill it in]
    Default branch [Your desired branch]
    Clean [Select true or false]
    Checkout submodules [Check if you have submodules]
  7. Click Save
  8. Give your build a name
  9. Click OK
  10. Click Queue build…
  11. Click OK

As you can see from the screenshot below, Team Services was able to clone the on-premises Bitbucket repository.

image

Comments (4) -

  • the check box "continous integration" is not available if you select Remote Git Repository.
  • is it possible to connect to a on premise GitHub Enterprise ?
    the GitHub connection type does not allow to specify the name of the host and with Remote Git Repository connection type Continous Integration is not available as option
  • We have to have Web hooks for CI to work. I don't think we have for Bitbucket yet. I will have to play with GitHub Enterprise and get back to you.
  • Hi Donovan,

    Is there a way to set this up using SSH authentication?  HTTPS access is disabled on our Bitbucket Server installation, so we are forced to use SSH, however I cannot see how to set it up.

Add comment

Loading