Skip to content

Commit

Permalink
Merge pull request #308 from amplication/docs/bitbucket-feedback
Browse files Browse the repository at this point in the history
Docs: Making adjustments to the Bitbucket page
  • Loading branch information
yuval-hazaz authored Nov 2, 2023
2 parents f4c1850 + d09705f commit 124ecf2
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 29 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 82 additions & 29 deletions docs/getting-started/sync-with-bitbucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,117 @@ slug: /sync-with-bitbucket

# Sync with Bitbucket


Amplication can push the code of your app to a Bitbucket or [GitHub](/sync-with-github) repository. It will provide you with full control over your project and will also allow you to easily track the code generated by Amplication.
Amplication can push the code of your app to a Bitbucket repository.
It will provide you with full control over your project and will also allow you to easily track the code generated by Amplication.

:::note
Amplication Free Plan works differently from the Pro and Enterprise Plans. See: [Differences between sync with a Git provider in Free edition and Pro/Enterprise Plans](/docs/getting-started/sync-with-git-diffrences-between-plans.md)
:::
Amplication's Sync With Bitbucket feature is **only available for users on an Enterprise plan**.
:::

## Creating a new repository on Bitbucket
This page provides you with everything you need to work with Bitbucket.
You'll learn how to do the following:

If you want to create a new repository on Bitbucket, start by navigating to your Bitbucket account and selecting the workspace where you'd like the new repository to be created. Once you're in the chosen workspace, simply click on 'Create Repository'. The URL for this action will typically look like this: `https://bitbucket.org/{your-bitbucket-workspace}/workspace/create/repository`
- [Authorize Bitbucket](#authorize-amplication-to-access-bitbucket)
- [Create a new Bitbucket repository](#create-a-new-bitbucket-repository)
- [Connect to a specific Bitbucket repository](#select-your-repository)
- [Change git providers for a specific service](#change-your-services-connected-git-provider)
- [Create a new pull request for Bitbucket](#create-a-new-pull-request)

## Working on Local Amplication Server
Let's dive right in.

If you are hosting a local Amplication server, you should first read [Connect Amplication server to Bitbucket](/docs/running-amplication-platform/connect-server-to-bitbucket.md) to see how to configure the Server to work with a new Bitbucket application.
## Prerequisites

## Using the Amplication hosted service
If you're running Amplication locally, first read [Connect Amplication server to Bitbucket](/running-amplication-platform/connect-server-to-bitbucket/).
You'll learn how to configure the server to work with a new Bitbucket application.

If you are using the hosted service on [https://app.amplication.com](https://app.amplication.com/), you can continue with this article.
## Authorize Amplication to access BitBucket

## Authorize Amplication to access your Bitbucket account
First, go to your project's dashboard.
You'll need to go to the _Sync with Git Provider_ page.
There are 3 ways to do this:

Before integrating your application with Bitbucket, you need to authorize Amplication to get access to your Bitbucket account.
1. Click _Sync with git provider_ on the sidebar.
2. Click on the _Sync with git provider_ tile on your project's dashboard.
3. Click _Connect to git_ on the footer at the bottom of the page.

1. Open up an Amplication project.
2. Click **Connect to git provider** at the sidebar or at the tile of your resource overview
![resource-overview-git-sync.png](./assets/sync-with-git-provider/resource-overview.png)

You're now on the _Sync with Git Provider_ page.
Proceed with the following steps to connect a Bitbucket repository to your service:

This wil lead you to _Sync with git provider_ page. Click on "Add organization" and on the opened modal, chose connect to Bitbucket:

![sync-with-git-provider](./assets/sync-with-git-provider/sync-with-git-provider.png)
1. Click on the `Select organization` dropdown.
2. Click on the `Add Organization` button at the bottom of the dropdown.
3. Click on the `Connect` button for Bitbucket that appears in the _Select Git Provider_ modal.

![select-git-provider](./assets/sync-with-git-provider/select-git-provider.png)
:::important
If you're already connected to Bitbucket, you can either add another Bitbucket organization or select an account you connected to previously.

You will be redirected to Bitbucket's authorization server and a page will then be displayed, outlining that the Amplication's OAuth consumer is requesting access to the resources on you Bitbucket account.

:::note
If you are not logged in to your Bitbucket account, the Bitbucket's authorization server will request you to log in first.
You can then go to [selecting your repository](#select-your-repository).
:::

You will be redirected to Bitbucket.

![amplication-bitbucket-oauth-consumer](./assets/sync-with-git-provider/amplication-bitbucket-consumer.png)

Once the connection is established, you have the flexibility to either create a new Bitbucket repository or connect to an existing one. Regardless of the option you choose, you will need to select the Bitbucket workspace. If you're creating a new repository, this will be the workspace where your new repository will reside. If you're connecting to an existing repository, this should be the workspace where your current repository is located.
Once the connection is established, you can either [create a new Bitbucket repository](#creating-a-new-repository-on-bitbucket) to connect with or select an existing one.
Regardless of the option you choose, **you will need to select the Bitbucket workspace**.

If you're creating a new repository, this will be the workspace where your new repository will reside.
If you're connecting to an existing repository, this should be the workspace where your current repository is located.

![select-workspace](./assets/sync-with-git-provider/select-workspace.png)

## Create a New Pull Request in Bitbucket
Now it's time to create a new repository or select an existing one.

## Create a new Bitbucket repository

First, navigate to your Bitbucket account and select the workspace where you'd like the new repository to live.
Once you're in the chosen workspace, click on `Create Repository`.

## Select Your Repository

You'll see a modal appear with a populated list of repositories based on your configuration settings from above.

![](./assets/first-service/select-repository.png)

## Change Your Service's Repository or Git Provider

Each project will have a default repository set when you create the first service.
Every new service you create within this project will inherit the default repo.

But, it's possible to override the default and set a new repo on a service-by-service basis.
There are **two ways** to do this:

1. When creating a new service using the Service Creation Wizard.
You will have the option to turn on the `Override default settings` toggle [during the Git Provider selection step](/first-service/#step-2-connect-your-github-repository).

2. By visiting the service's _Sync With Git Provider_ page.
On this page you can also turn on the `Override default settings` toggle and change the target repo for the service.

You will be able to connect a new git provider, like [GitHub](/sync-with-github) or another Bitbucket account.

After selecting the git provider and organization you want to proceed with, the [repository selection modal](#select-your-repository) will appear again.
You can now select a new repository for this specific service.

## Create a New Pull Request

First, make changes to your service.

:::important
Follow our [Building New Versions of Your Service](/building-new-versions) guide to go through the steps of changing and making additions to your service.
:::

To initiate a new pull request in Bitbucket, follow these steps:
After making changes to your service, navigate to the Pending Changes section in the right sidebar. Write a commit message and click on `Commit Changes & Build`.

- Navigate to the right side of the page and click on "Commit Changes & Build", followed by clicking on the most recent commit.
- This action will take you to the commits page. Here, select the service for which you wish to view the build log.
- Once the build process is completed, you can open a pull request. You can do this by clicking either on the footer or on the "Push Changes to Bitbucket" action step.
This will take you to the commits page.
Here you can select the service for which you wish to view the build log.
Once the build process is completed, you can open the pull request generated by Amplication within Bitbucket.
You can do this by clicking either on the footer or on the "Push Changes to Bitbucket" action step.

![push-to-bitbucket-build](./assets/sync-with-git-provider/push-to-bitbucket.png)

And there you have it – a new pull request ready for review.

![bitbucket-pull-request](./assets/sync-with-git-provider/bitbucket-pull-request.png)

Amplication creates pull requests from the `amplication` branch into your repository's default base branch. Pro and Enterprise users can [change the base branch for these pull requests](/how-to/change-base-branch-for-pull-requests).
Amplication creates pull requests from the `amplication` branch into your repository's default base branch. Pro and Enterprise users can [change the base branch for these pull requests](/how-to/change-base-branch-for-pull-requests)

0 comments on commit 124ecf2

Please sign in to comment.