You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/sonarqube-issues/README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,9 @@ This plugin requires a proxy to SonarQube. To set up:
31
31
- Create a proxy:
32
32
33
33
- Navigate to Plugins, then click on the Proxies tab, then click on Create Proxy
34
-
- Give the proxy a name, then click on Add URL
35
-
- For the URL Prefix, type in the base URL of your SonarQube instance. Default for cloud is `https://sonarcloud.io`. **This URL prefix should be exactly the same as the value of the baseURL variable in [SonarqubeIssues.tsx](src/components/SonarqubeIssues.tsx) - If you are self-hosting SonarQube, you will have to put your own base URL in both places!**
36
-
- Click on Add Header and add a header whose name is `Authorization` and whose value is `Bearer {{secrets.sonarqube_plugin}}` (include the curly braces!)
34
+
- Give the proxy a name, like SonarQube Proxy, then click on Add URL.
35
+
- For the URL Prefix, type in the API base URL of your SonarQube instance. The default for cloud is `https://sonarcloud.io`. **If you are self-hosting SonarQube, you will have to put in your own base URL instead.**
36
+
- Click on Add Header and add a header whose name is `Authorization` and whose value is `Bearer {{{secrets.sonarqube_plugin}}}` (include the curly braces!)
37
37
38
38
- Once you are done, the proxy should look like the below:
39
39
@@ -53,14 +53,26 @@ Now, you can build and add the plugin.
53
53
- In The **Plugin code** section, upload the `dist/ui.html` file you just built.
54
54
- Click on **Save plugin**
55
55
56
-
Now, when you navigate to a Service that has a SonarQube associated with it, you should be able to click on Plugins > SonarQube Issues and see the SonarQube Issues associated with the project that is linked to the service.
56
+
### Create a plugin configuration entity (self-hosted only)
57
57
58
-
**Note: This plugin will connect to SonarQube's cloud instance out of the box.** If you are self-hosting SonarQube and need to direct the plugin to a different API endpoint, update the following section of the [SonarqubeIssues.tsx](src/components/SonarqubeIssues.tsx) file:
58
+
This plugin will connect to SonarQube's cloud instance out of the box, so if you are using SonarQube in the cloud, you should skip this step. If you are self-hosting SonarQube and need to direct the plugin to a different REST API endpoint, create a plugin configuration entity with your SonarQube REST API base URL as follows:
59
+
60
+
- Consider creating a new entity type, so that any existing scorecards are not affected by this configuration entity. In this example, we have created a new entity type called `plugin-configuration`
61
+
- Create a new entity with the tag `sonarqube-plugin-config`
62
+
- Set `x-cortex-definition.sonarqube-url` to the value of your SonarQube API base URL. For example, if my SonarQube API base URL was `https://sonarqube.martindstone.com`, my `sonarqube-plugin-config` entity would look like this:
59
63
60
-
```ts
61
-
// Set your SonarQube url. Cloud is https://sonarcloud.io
62
-
const baseURL = "https://sonarcloud.io";
63
64
```
65
+
openapi: 3.0.1
66
+
info:
67
+
title: SonarQube Plugin Config
68
+
description: ""
69
+
x-cortex-tag: sonarqube-plugin-config
70
+
x-cortex-type: plugin-configuration
71
+
x-cortex-definition:
72
+
sonarqube-url: https://sonarqube.martindstone.com
73
+
```
74
+
75
+
Now, when you navigate to a Cortex service that has a SonarQube project associated with it, you should be able to click on Plugins > SonarQube Issues and see the SonarQube Issues associated with the project that is linked to the service.
0 commit comments