aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-docs/src/pages/integrations
diff options
context:
space:
mode:
authorlaurawacrenier <laurawacrenier@gmail.com>2018-06-12 10:33:12 +0200
committerSonarTech <sonartech@sonarsource.com>2018-06-12 20:20:58 +0200
commita1ae97a0d15fbe5038f219734a9518d13cfde17a (patch)
treed37925d26ea6a386c7f9168e6c704222e45ee5de /server/sonar-docs/src/pages/integrations
parent7bbf218b9ffac963b54aa472286496a8b38bffb3 (diff)
downloadsonarqube-a1ae97a0d15fbe5038f219734a9518d13cfde17a.tar.gz
sonarqube-a1ae97a0d15fbe5038f219734a9518d13cfde17a.zip
MMF-1319 Document SC specific features (#318)
* Adding pages to SonarCloud doc * Add page for paid plan * Adding documentation about integrations in SonarCloud * Add page suggestions * Add inline documentation * Allow to reference SonarCloud links in the documentation * Update the way to install the Bitbucket Cloud App since it is now available in the marketplace
Diffstat (limited to 'server/sonar-docs/src/pages/integrations')
-rw-r--r--server/sonar-docs/src/pages/integrations/bitbucketcloud.md79
-rw-r--r--server/sonar-docs/src/pages/integrations/github.md31
-rw-r--r--server/sonar-docs/src/pages/integrations/index.md10
-rw-r--r--server/sonar-docs/src/pages/integrations/vsts.md37
4 files changed, 157 insertions, 0 deletions
diff --git a/server/sonar-docs/src/pages/integrations/bitbucketcloud.md b/server/sonar-docs/src/pages/integrations/bitbucketcloud.md
new file mode 100644
index 00000000000..4fd2e775166
--- /dev/null
+++ b/server/sonar-docs/src/pages/integrations/bitbucketcloud.md
@@ -0,0 +1,79 @@
+---
+title: Integration with Bitbucket Cloud
+scope: sonarcloud
+---
+
+## Authentication
+
+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.
+
+## Analyzing with Pipelines
+
+SonarCloud integrates with Bitbucket Pipelines to make it easier to trigger analyses. Follow the steps:
+
+1. On SonarCloud, open and follow the "New Project" tutorial available from the `+` icon available at the top right part of the screen. You can copy-paste the command line displayed at the end.
+
+2. On Bitbucket Cloud, go to the "Settings > Pipelines > Environment variables" page of your team, and add a new SONAR_TOKEN variable that contains the value of the SonarCloud token (something like `9ad01c85336b265406fa6554a9a681a4b281135f`) which you created during the [tutorial](/#sonarcloud#/onboarding) (and which is available inside the command line that you copy-pasted). **Make sure that you click on the "Lock" icon to encrypt and hide this token.**
+
+3. Inside the `bitbucket-pipelines.yml` file of your repository, copy the command line provided by the tutorial and replace the actual token by its variable name. For example, for a Java Maven-based project, you should have something like:
+
+```
+script:
+ -mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=my-team-org -Dsonar.login=$SONAR_TOKEN
+```
+
+When this 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.
+
+4. Once you see your project in SonarCloud, go to the Bitbucket Cloud "Settings > SonarCloud" page of your repository and find it in the select box to link it.
+
+From now on, everytime Pipelines triggers a build, SonarCloud will:
+
+* Analyze every new branch that contains the change on the `bitbucket-pipelines.yml` file.
+* Analyze and decorate every pull request based on such a branch.
+
+## Quality widget
+
+SonarCloud provides a widget that shows the current quality metrics of your project directly on the repository's Overview page on Bitbucket Cloud.
+
+If you have configured the analysis with Pipelines as described above, you will see this widget on the "Overview" page of your repository.
+
+If you haven't configured the analysis with Pipelines (maybe because you are using another CI tool), follow these few steps:
+
+1. Go to the repository where you want to display the widget. On the "Overview" page, you should see an empty SonarCloud widget. Click on the link inside the empty widget or just go directly to your repository's "Settings > SonarCloud Settings".
+
+2. If you're not already logged in on SonarCloud, do it by using the options provided there. You can log in with Bitbucket Cloud by clicking on the blue button, or click on "More options" to log in with GitHub or VSTS.
+
+3. Once you're logged in on SonarCloud, you should see a dropdown allowing you to choose one of the projects you administer. Just choose the one you want to link to this Bitbucket repository and click "Save".
+
+4. You can now go back to your repository's Overview page on Bitbucket and see the widget with all current SonarCloud metrics displayed.
+
+If you want to hide this widget (e.g. because your repository is not analyzed on SonarCloud), you can go to the "Settings > SonarCloud" page of your repository and check "Hide repository overview widget".
+
+## FAQ
+
+**Do you have a sample project on Bitbucket Cloud?**
+For the time being, you can take a look at this very simple JS project: [Sample project analysed on SonarCloud](https://bitbucket.org/bellingard/fab)
+
+**Pipelines can't find sonar-scanner**
+If you want to analyze a non-Java project (JS, TS, PHP, Python, Go, ...), you will need to download and install the [Scanner CLI](https://redirect.sonarsource.com/doc/install-configure-scanner.html) during the execution of your build prior to the actual code scan. You have two options:
+
+* You can download it (with curl for instance) from the links available on the documentation page and unpack it (preferably in a cached folder for later reuse).
+* On Node environments, you can rely on a [community NPM module](https://www.npmjs.com/package/sonarqube-scanner) to install it globally and therefore make it available in the PATH.
+
+**I don't see the any quality information whereas I configured everything**
+Make sure that your browser is not using some extensions like AdBlocks. They tend to break the integration of third-party applications in BitBucket Cloud.
+
+## Upcoming features and improvements
+
+There are various areas in which you can expect new features and improvements:
+
+* Tighter integration with Pipelines (less parameters to pass on the CLI, availability of the scanner, ...)
+* Pull request decoration with inline comments to show the issues within the PR
+* Better and easier team onboarding
+* Automatic analysis (i.e. no need to configure anything from Pipelines)
diff --git a/server/sonar-docs/src/pages/integrations/github.md b/server/sonar-docs/src/pages/integrations/github.md
new file mode 100644
index 00000000000..ec2977932fd
--- /dev/null
+++ b/server/sonar-docs/src/pages/integrations/github.md
@@ -0,0 +1,31 @@
+---
+title: Integration with GitHub
+scope: sonarcloud
+---
+
+## Authentication
+
+You can connect to SonarCloud using your GitHub account. On the [login page](/#sonarcloud#/sessions/new), just click on the "Log in with GitHub" button.
+
+## Trigger analyses
+
+SonarCloud currently does not trigger analyses automatically. It's up to you to launch them inside your
+existing CI scripts. Please follow the [tutorial](/#sonarcloud#/onboarding) to get started.
+
+If you are using Travis CI, the SonarCloud Travis Add-on will make it easier to activate analyses. Simply follow
+the [guide to integrating with Travis CI](https://docs.travis-ci.com/user/sonarcloud/).
+
+## Activating pull request decoration
+
+To have your pull requests decorated by SonarCloud in GitHub, you need to [install the SonarCloud application](https://github.com/apps/sonarcloud) on your GitHub organization(s).
+
+Once installed, there is nothing more to do if you are using the Travis Add-on. In any other case, you will need
+to pass the following properties in your script during the analysis:
+
+```
+sonar.pullrequest.base=master
+sonar.pullrequest.branch=feature/my-new-feature
+sonar.pullrequest.key=5
+sonar.pullrequest.provider=GitHub
+sonar.pullrequest.github.repository=my-company/my-repo
+```
diff --git a/server/sonar-docs/src/pages/integrations/index.md b/server/sonar-docs/src/pages/integrations/index.md
new file mode 100644
index 00000000000..01fcb49fe8f
--- /dev/null
+++ b/server/sonar-docs/src/pages/integrations/index.md
@@ -0,0 +1,10 @@
+---
+title: Integrations
+scope: sonarcloud
+---
+
+SonarCloud integrates with the following cloud services to help developers get the most out of their code:
+
+* [Integration with GitHub](/integrations/github)
+* [Integration with Bitbucket Cloud](/integrations/bitbucketcloud)
+* [Integration with VSTS](/integrations/vsts)
diff --git a/server/sonar-docs/src/pages/integrations/vsts.md b/server/sonar-docs/src/pages/integrations/vsts.md
new file mode 100644
index 00000000000..4166445e89f
--- /dev/null
+++ b/server/sonar-docs/src/pages/integrations/vsts.md
@@ -0,0 +1,37 @@
+---
+title: Integration with VSTS
+scope: sonarcloud
+---
+
+
+## Authentication
+
+You can connect to SonarCloud using your VSTS account. On the [login page](/#sonarcloud#/sessions/new), just click on the "Log in with VSTS" button.
+
+** /!\ Warning:** Only work and school VSTS accounts are authorized to login on SonarCloud.
+
+## Install the SonarCloud VSTS extension
+
+The SonarCloud VSTS extension brings everything you need to have your projects analyzed on SonarCloud
+very quickly:
+* Integration with the Build definitions to easily trigger the analysis
+* Pull request decoration to get quick feedback on the code changes
+* Widget to have the overview quality of your projects inside VSTS dashboards
+
+Install [SonarCloud extension for VSTS](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud)by clicking on the "Get it free" button.
+
+Then follow the comprehensive [Microsoft lab on how to integrate VSTS with SonarCloud](https://aka.ms/sonarcloudlab).
+
+## Quality Gate Status widget
+
+You can monitor the Quality Gate status of your projects directly in your VSTS dashboard. Follow these simple steps to configure your widget:
+
+1. Once the VSTS extension is installed and your project has been successfully analyzed, go to one of your VSTS dashboards (or create one). Click on the pen icon in the bottom right corner of the screen, and then on the "+" icon to add a widget.
+
+2. In the list of widgets, select the "Code Quality" one and then click on the "Add" button. An empty widget is added to your dashboard.
+
+3. You can then click on the widget's cogwheel icon to configure it.
+
+ * **For public projects:** you can simply select your project from the dropdown. A searchbar inside the dropdown will help you find it easily. Just select it and click on the "Save" button.
+
+ * **For private projects:** you'll have to log in using the links provided under the dropdown. Once logged in, your private projects will appear in the dropdown. Select the one you are interested in, and click on "Save". \ No newline at end of file