How to integrate Buddy with a private Git repository

How to integrate Buddy with a private Git repository

Every project in Buddy is based on a Git repository. You can choose between GitHub, Bitbucket and GitLab providers, or Buddy's fully-featured native hosting. But what if you host your code elsewhere or only want to add a single repository without giving access to your whole GitHub account? Does it mean you won't be able to take advantage of Buddy's awesome features?

Not at all.

All you need to do is to use the Private repository option. Configuration is simple:

  1. Paste the URL to the repository
  2. Select the authorization method
  3. Configure a web hook and add it to the repository

This article will walk you through the process step on an example of a single GitHub repo. Let's go!

Adding a project to Buddy

Let's begin with setting up a project in Buddy:

  1. Sign up to Buddy at https://buddy.works/.
  2. Create a new project and select Your Private Git Server as the provider.
  3. Enter the Name for your project and paste the Repository URL.
  4. Download or copy the SSH key – we'll need that for the next part.
  5. Click Create a new project when done. Image loading...Creating a custom repository

Authorizing Buddy in GitHub

Configuring deploy keys

Now ne need to add a deploy key so that Buddy can pull your repository to ship code:

  1. Select the repository that you want to synchronize in your GitHub profile.
  2. Go to SettingsDeploy keys and click Add deploy key.
  3. Paste the key that you copied from Buddy and enter its details.
  4. Click Add key when done. Image loading...Adding deploy keys

Configuring web hooks

The last part is adding a web hook that will trigger deployments and update the list of commits in Buddy on changes to your repo:

  1. Switch to Buddy and go to the Code tab.
  2. Click Refresh in the right column and copy the webhook. Image loading...Refreshing the repository
  3. Switch back to GitHub, go to SettingsWebhooks and click Add webhook.
  4. Paste the webhook in the Payload URL and select Send me everything.
  5. Click Add webhook when done. Image loading...Adding a webhook

That's it! You can use Buddy to automatically build, test and deploy code on every push to the selected branch in your private repo.

Jarek Dylewski

Jarek Dylewski

Customer Support

A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.