Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit f478974f authored by Daya Adianto's avatar Daya Adianto
Browse files

Revert "Fix GitLab CI job that runs SonarScanner"

This reverts commit da2657b1.
parent da2657b1
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,7 @@ stages:
- deploy
SonarScanner Analysis:
image:
name: addianto/sonar-scanner-cli:latest
entrypoint:
- "/bin/bash"
image: addianto/sonar-scanner-cli:latest
stage: test
script:
- sonar-scanner
......@@ -30,4 +27,4 @@ Publish to Docker Hub:
tags:
- docker
only:
- master
- master
\ No newline at end of file
......@@ -43,8 +43,7 @@ ENV DEBIAN_FRONTEND=''
## the value of USERNAME above
USER sonar
WORKDIR /home/sonar/workspace
ENTRYPOINT ["sonar-scanner"]
CMD ["sonar-scanner"]
# Container image metadata
## Note to editors: metadata values for `created`, `version`, and `revision`
......
......@@ -13,26 +13,25 @@ into SonarScanner via CLI prompt.
To run the container image locally using Docker:
```bash
docker run -v $(pwd):/home/sonar/workspace addianto/sonar-scanner-cli:latest [sonar-scanner options]
docker run -it -v $(pwd):/home/sonar/workspace addianto/sonar-scanner-cli:latest bash
sonar-scanner [sonar-scanner options]
```
> Note: The above example creates a local interactive shell within the running
> container where you can invoke `sonar-scanner` with the desired CLI options.
Example:
```bash
docker run -v $(pwd):/home/sonar/workspace addianto/sonar-scanner-cli:latest -Dsonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube -Dsonar.login=[REDACTED]
docker run -it -v $(pwd):/home/sonar/workspace addianto/sonar-scanner-cli:latest bash
sonar-scanner -Dsonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube -Dsonar.login=[YOUR TOKEN]
```
> Note: It is also possible to pass all possible SonarScanner's properties
> via CLI options. YMMV.
To use the container image as a base image for a CI job on GitLab CI/CD:
```yaml
SonarScanner Analysis:
image:
name: addianto/sonar-scanner-cli:latest
entrypoint:
- "/bin/bash"
image: addianto/sonar-scanner-cli:latest
# Ideally you want to run SonarScanner after the test suite has generated
# test & coverage report. The following is only an example to run
# SonarScanner concurrently with CI job(s) in `test` stage.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment