Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| en:modul:m324_aws:topics:11 [2025/10/15 14:22] – angelegt dgaravaldi | en:modul:m324_aws:topics:11 [2026/01/10 10:21] (aktuell) – [Getting started] dgaravaldi | ||
|---|---|---|---|
| Zeile 24: | Zeile 24: | ||
| * A text editor or IDE | * A text editor or IDE | ||
| + | \\ | ||
| === Step 1: Download and start SonarQube === | === Step 1: Download and start SonarQube === | ||
| SonarQube must be run on servers or virtual machines because it is an on-premise solution (VMs). Without having to explicitly configure the server on your system, starting up an instance can be replaced by installing a Docker container from the Sonar image. | SonarQube must be run on servers or virtual machines because it is an on-premise solution (VMs). Without having to explicitly configure the server on your system, starting up an instance can be replaced by installing a Docker container from the Sonar image. | ||
| Zeile 39: | Zeile 40: | ||
| </ | </ | ||
| + | \\ | ||
| === Step 2: Create a new project === | === Step 2: Create a new project === | ||
| * As Project type select '' | * As Project type select '' | ||
| - | Then set '' | + | * Then set '' |
| + | * Hit the button '' | ||
| + | * Select '' | ||
| * Hit the button '' | * Hit the button '' | ||
| + | \\ | ||
| === Step 3: Analysis method === | === Step 3: Analysis method === | ||
| * As analysis method select '' | * As analysis method select '' | ||
| Zeile 49: | Zeile 54: | ||
| * Save the generated token and handle it as password. | * Save the generated token and handle it as password. | ||
| * Hit the button '' | * Hit the button '' | ||
| + | * Run analysis on your project: '' | ||
| + | |||
| + | |||
| + | \\ | ||
| === Step 4: Download and unzip the scanner === | === Step 4: Download and unzip the scanner === | ||
| * Download the scanner for your platform. | * Download the scanner for your platform. | ||
| - | | + | |
| - | * Add the '' | + | {{: |
| + | {{: | ||
| + | |||
| + | | ||
| + | Example for Linux on AWS EC2 | ||
| + | < | ||
| + | wget -N https:// | ||
| + | sudo apt install unzip | ||
| + | unzip -o sonar-scanner-cli-< | ||
| + | </ | ||
| + | |||
| + | * Add the '' | ||
| + | < | ||
| + | whereis sonar-scanner | ||
| + | sonar-scanner: | ||
| + | </ | ||
| * Check before running code coverage that your target app (i.e. traffic light api) has the following node package are installed. | * Check before running code coverage that your target app (i.e. traffic light api) has the following node package are installed. | ||
| Zeile 86: | Zeile 110: | ||
| </ | </ | ||
| + | \\ | ||
| === Step 5: Run the tests === | === Step 5: Run the tests === | ||
| + | * On Linux: Install jest with '' | ||
| * Run first the code coverage with jest. | * Run first the code coverage with jest. | ||
| Zeile 94: | Zeile 120: | ||
| * Execute the scanner as shown. | * Execute the scanner as shown. | ||
| - | In the example the scanner binaries are stored in the project folder. The path to the scanner is used in a bash script. | ||
| < | < | ||
| - | #!/usr/bin/env bash | + | # |
| + | # Attention: | ||
| + | # Change CRLF (Windows) to LF (Unix on AWS) in your Editor | ||
| # | # | ||
| - | # set tool variable | + | sonar-scanner |
| - | tool=??/ | + | |
| - | # run tool | + | |
| - | $tool | + | |
| + | -Dsonar.token=< | ||
| + | -Dproject.settings=./ | ||
| </ | </ | ||
| * Analyse the generated report in SonarQube | * Analyse the generated report in SonarQube | ||
| - | --- | + | {{: |
| - | Based on [[https:// | ||
| ---- | ---- | ||
| + | Source: [[https:// | ||
| [[https:// | [[https:// | ||