Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Format the Scan Source Code section

...

Ensure the prerequisites are applied.

Build and Run

Code Block
languagebash
titleRun both SoanrQube and Postgres services
# 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

  1. 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

...

  1. Create

...

  1. a

...

  1. project
    give

...

  1. a

...

  1. name

...

  1. of

...

  1. the

...

  1. project.

...

  1. Generate

...

  1. a

...

  1. token
    Give

...

  1. a

...

  1. name

...

  1. to

...

  1. the

...

  1. token.

...

  1. Select

...

  1. the

...

  1. language

...

  1. for

...

  1. the

...

  1. project

...

  1. to

...

  1. be

...

  1. analyzed.

...

...

  1. Select the

...

  1. OS

...

  1. of

...

  1. the

...

  1. project

...

  1. to

...

  1. be

...

  1. analyzed.

...

  1. Execute the

...

  1. command

...

  1. in

...

  1. the

...

  1. project

...

  1. folder.

...

...

  1. Example:

    Code Block
    languagebash
    sonar-scanner \
      -Dsonar.projectKey=tss-devops \
      -Dsonar.sources=. \
      -Dsonar.host.url=http://localhost:9000 \
      -Dsonar.login=161e7fe1462c7f291782a6f16ac63a809f81ec48

...


  1. Review the

...

  1. code

...

  1. analysis

...

  1. report

...

  1. in

...

  1. the

...

  1. browser.