README.md 596 Bytes
Newer Older
Jan Grewe's avatar
Jan Grewe committed
1
2
3
4
5
6
7
8
9
10
11
12
13
# sonar-scanner
This Docker image contains the sonar-scanner

A `.gitlab-ci.yml` with caching of your project's dependencies would look like this:

```
stages:
- test

sonarqube:
  image: registry.faked.org/gitlab-ci/sonar-scanner
  stage: test
  script:
Jan Grewe's avatar
Jan Grewe committed
14
    - sonar-scanner -Dsonar.projectBaseDir=$(pwd) -Dsonar.projectVersion=${CI_COMMIT_SHORT_SHA}
Jan Grewe's avatar
Jan Grewe committed
15
16
17
18
19
20
21
22
23
24
```

Make sure you put a `sonar-project.properties` file into the root of your repo:
```
sonar.host.url=https://sonar.example.com
sonar.login=AValidSonarqubeUserToken
sonar.projectKey=myproject
sonar.projectName=My Project
sonar.sources=app
```