...
Ensure the prerequisites are applied.
Build and Run
Code Block | ||||
---|---|---|---|---|
| ||||
# Ensure that vm.max_map_count is set to 262144 on the docker host machine # (and not 65535 which is the default) sudo sysctl -w vm.max_map_count=262144 # Build and Run the services cd <path containing docker-compose.yml> docker-compose up |
...
Scan Source Code
- Authenticate as an admin to the SonarQube service
open a browser and navigate to the docker host IP with port 9000
Login using credentials admin/admin
...
Create
...
a
...
project
give
...
a
...
name
...
of
...
the
...
project.
...
Generate
...
a
...
token
Give
...
a
...
name
...
to
...
the
...
token.
...
Select
...
the
...
language
...
for
...
the
...
project
...
to
...
be
...
analyzed.
...
...
Select the
...
OS
...
of
...
the
...
project
...
to
...
be
...
analyzed.
...
Execute the
...
command
...
in
...
the
...
project
...
folder.
...
...
Example:
Code Block language bash sonar-scanner \ -Dsonar.projectKey=tss-devops \ -Dsonar.sources=. \ -Dsonar.host.url=http://localhost:9000 \ -Dsonar.login=161e7fe1462c7f291782a6f16ac63a809f81ec48
...
Review the
...
code
...
analysis
...
report
...
in
...
the
...
browser.