Browse Source

Simplify Bitbucket Cloud "Get Started" docs

tags/7.7
Fabrice Bellingard 5 years ago
parent
commit
c0d01d9fab

+ 3
- 1
server/sonar-docs/README.md View File

@@ -102,14 +102,16 @@ All urls _must_ end with a trailing slash (`/`).

Each documentation file should contain a header at the top of the file delimited by "---" top and bottom. The header holds file metadata:

* The `title` tag defines the title of the page for the index
* The `title` tag defines the title of the page.
* The `url` tag is required and defines the path at which to publish the page. Reminder: end this with a trailing slash.
* The `nav` tag is optional and controls the title of the page inside the navigation tree.

Ex.:

```
---
title: Demo page
nav: Demo
url: /sonarcloud-pricing/
---
```

+ 15
- 12
server/sonar-docs/src/pages/sonarcloud/integrations/bitbucketcloud.md View File

@@ -1,25 +1,28 @@
---
title: Bitbucket Cloud
title: Get started with Bitbucket Cloud
nav: Bitbucket Cloud
url: /integrations/bitbucketcloud/
---

You can connect to SonarCloud using your Bitbucket Cloud account. On the [login page](/#sonarcloud#/sessions/new), just click on the "Log in with Bitbucket" button.

## Install SonarCloud add-on for Bitbucket Cloud

Our Bitbucket Cloud application allows users to automate the SonarCloud analysis with Pipelines. It also allows users to view their SonarCloud metrics directly on Bitbucket Cloud via our Code Quality widget and the decoration of pull-requests.

In Bitbucket Cloud, go to your team's "Settings > Find integrations" page, search for "SonarCloud" in the "Code Quality" category and click on "Add" to install the application.
## Sign up and set up your first project
1. On the [login page](/#sonarcloud#/sessions/new), click on the "Log in with Bitbucket" button and connect to SonarCloud using your Bitbucket Cloud account.
2. Click on "Analyze your code" and follow the path to set up a first project
3. You will be asked to install the SonarCould application on your team or user account, which will allow you to
choose which repositories you want to analyze.

## Analyzing with Pipelines

1. On SonarCloud, once your project is created, generate a token to allow to publish analysis from Bitbucket Pipelines. To generate a token, follow the first step of the tutorial on the dashboard of the project, or go to your user security page.
Once your project is created and initiated from the repository you selected:

1. Generate a token to allow to publish analysis from Bitbucket Pipelines. To generate a token, follow the first step of the tutorial on the dashboard of the project, or go to your user security page.

2. On Bitbucket Cloud, go to the "Settings > Pipelines > Account variables" page of your team, and add a new SONAR_TOKEN variable that contains the value of the SonarCloud token (something like `9ad01c85336b265406fa6554a9a681a4b281135f`). **Make sure that you click on the "Lock" icon to encrypt and hide this token.**
2. On Bitbucket Cloud, go to the "Settings > Pipelines > Account variables" page of your team, and add a new SONAR_TOKEN variable that contains the value of the SonarCloud token (something like `9ad01c85336b265406fa6554a9a681a4b281135f`).
* **Make sure that you click on the "Lock" icon to encrypt and hide this token.**

3. Edit the `bitbucket-pipelines.yml` file of your repository to trigger the SonarCloud analysis. If you have a Maven or Gradle project, the simplest way is to use our dedicated plugins. For most other projects, you need our command line scanner to trigger analyses. See [various example projects](https://bitbucket.org/account/user/sonarsource/projects/SAMPLES).
3. Edit the `bitbucket-pipelines.yml` file of your repository to trigger the SonarCloud analysis. See [our various example projects](https://bitbucket.org/account/user/sonarsource/projects/SAMPLES) to see how to achieve this.
* Note: if you did not activate Pipelines prior to this step, you should go to the "Pipelines" menu entry on your repository to enable it.

When a change on `bitbucket-pipelines.yml` is committed and pushed, Pipelines should automatically run a new build and therefore trigger the analysis of the repository. Shortly after, your project will appear on SonarCloud in your organization.
Once those changes are pushed, Pipelines will automatically trigger analyses on the repository.

## Analyzing pull requests with Pipelines


+ 2
- 1
server/sonar-docs/src/pages/sonarcloud/integrations/github.md View File

@@ -1,5 +1,6 @@
---
title: GitHub
title: Get started with GitHub
nav: GitHub
url: /integrations/github/
---


+ 2
- 1
server/sonar-docs/src/pages/sonarcloud/integrations/vsts.md View File

@@ -1,5 +1,6 @@
---
title: Azure DevOps
title: Get started with Azure DevOps
nav: Azure DevOps
url: /integrations/vsts/
---


Loading…
Cancel
Save