Commit a92fcb15 authored by Jan Grewe's avatar Jan Grewe
Browse files

initial commit

parents
Pipeline #387 passed with stages
in 44 seconds
stages:
- build
- push
build:
stage: build
script:
- docker build -t registry.faked.org/gitlab-ci/sonar-scanner:latest .
push:
stage: push
script:
- docker push registry.faked.org/gitlab-ci/sonar-scanner:latest
FROM openjdk:8-alpine
MAINTAINER Jan Grewe <jan@faked.org>
ENV VERSION 3.0.3.778
RUN apk add --no-cache curl grep sed unzip
RUN curl -skLo /tmp/sonar-scanner.zip https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${VERSION}-linux.zip \
&& unzip /tmp/sonar-scanner.zip -d /opt \
&& mv /opt/sonar-scanner-${VERSION}-linux /opt/sonar-scanner \
&& rm /tmp/sonar-scanner.zip
RUN sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /opt/sonar-scanner/bin/sonar-scanner
ENV SONAR_RUNNER_HOME=/opt/sonar-scanner
ENV PATH $PATH:/opt/sonar-scanner/bin
WORKDIR /src
# 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:
- sonar-scanner -Dsonar.projectBaseDir=$(pwd)
```
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.projectVersion=1
sonar.sources=app
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment