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
+24-10Lines changed: 24 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -27,22 +27,41 @@ info:
27
27
This plugin requires a proxy to SonarQube. To set up:
28
28
29
29
- Create a token in SonarQube by clicking on your profile > My Account > Security
30
-
- In Cortex, define a secret whose value is your new token. Name it `sonarqube_plugin`.
30
+
- In Cortex, define a secret whose value is your new token. Name it `sonarqube_secret`.
31
31
- Create a proxy:
32
32
33
33
- Navigate to Plugins, then click on the Proxies tab, then click on Create Proxy
34
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!)
35
+
- For the URL Prefix, type in the API base URL of your SonarQube instance. Default for cloud is `https://sonarcloud.io`. If you are self-hosting SonarQube, you will have a different API base URL.
36
+
- Click on Add Header and add a header whose name is `Authorization` and whose value is `Bearer {{secrets.sonarqube_secret}}` (include the curly braces!)
37
37
38
38
- Once you are done, the proxy should look like the below:
The plugin uses `https://sonarcloud.io` as its default API base URL. If you are self-hosting Sonarqube, then you will have a different URL. To configure the plugin to use that URL, you can create a Sonarqube plugin configuration entity in Cortex with your own API base URL.
45
+
46
+
- Consider creating a new entity type, so that any existing scorecards are not affected by ths configuration entity. In this example, we have created a new entity type called `plugin-configuration`
47
+
- Create a new entity with the tag `sonarqube-plugin-config`
48
+
- Set `x-cortex-definition.sonarqube-api-url` to the value of your ServiceNow Instance URL. For example, if my Sonarqube API base URL was `https://sonarqube.martindstone.com`, my `sonarqube-plugin-config` entity would look like this:
- Make sure you have npm/yarn, and make sure you have put in your correct SonarQube Base URL in the baseURL variable in [SonarqubeIssues.tsx](src/components/SonarqubeIssues.tsx)
64
+
- Make sure you have npm/yarn
46
65
- In your terminal, in the `sonarqube-issues` directory, type `yarn` or `npm install` to install the dependencies; then type `npm run build` or `yarn build` to build the plugin
47
66
- The compiled plugin will be created in `dist/ui.html`
48
67
- In Plugins > All, click **Register Plugin**
@@ -55,12 +74,7 @@ Now, you can build and add the plugin.
55
74
56
75
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.
57
76
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:
59
-
60
-
```ts
61
-
// Set your SonarQube url. Cloud is https://sonarcloud.io
62
-
const baseURL = "https://sonarcloud.io";
63
-
```
77
+
**Note: This plugin will connect to Sonarqube's cloud API service out of the box.** If you are self-hosting SonarQube and need to direct the plugin to a different API base URL, make sure you follow the **Self-hosted setup** instructions above.
0 commit comments