I have set up a gitlabs account, set up a sonar account and tried to get sonar to scan my php app
As per the walk through I set up the CI/CD variables.
When the pipeline runs it gives errors:
NFO: Total time: 33.084s
INFO: Final Memory: 8M/61M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.organization
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Cleaning up file based variables
ERROR: Job failed: exit code 1
As there is no requirement or information on setting up those two variables in the Sonar documentation they are not setup.
Where do I get values for these and where do I set them up
THe yml file looks like:
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
sonarcloud-check:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
only:
- merge_requests
- master
- develop