From 272f7129ded3815cfc340ab3fce54ef564ae7b00 Mon Sep 17 00:00:00 2001
From: Jan Grewe <jan@faked.org>
Date: Wed, 19 Jun 2019 18:41:08 +0200
Subject: [PATCH] update sonar-scanner add ansible-lint use short hash in
 example

---
 .gitlab-ci.yml |  1 -
 Dockerfile     | 20 ++++++++++++++++----
 README.md      |  2 +-
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b801df4..008281e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,4 +9,3 @@ push:
   stage: push
   script:
     - docker push registry.faked.org/gitlab-ci/sonar-scanner:latest
-
diff --git a/Dockerfile b/Dockerfile
index 09f5895..3feb887 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,17 +1,29 @@
 FROM openjdk:8-alpine
 MAINTAINER Jan Grewe <jan@faked.org>
 
-ENV VERSION 3.0.3.778
+ENV VERSION 3.3.0.1492
 
-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 \
+RUN apk add --no-cache \
+  curl \
+  gcc \
+  grep \
+  libffi-dev \
+  musl-dev \
+  openssl-dev \
+  sed \
+  py3-pip \
+  python3-dev \
+  unzip
+
+RUN curl -skLo /tmp/sonar-scanner.zip https://binaries.sonarsource.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
 
+RUN pip3 install ansible-lint
+
 ENV SONAR_RUNNER_HOME=/opt/sonar-scanner
 ENV PATH $PATH:/opt/sonar-scanner/bin
 WORKDIR /src
-
diff --git a/README.md b/README.md
index afccb5f..4201f5a 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ sonarqube:
   image: registry.faked.org/gitlab-ci/sonar-scanner
   stage: test
   script:
-    - sonar-scanner -Dsonar.projectBaseDir=$(pwd) -Dsonar.projectVersion=${CI_COMMIT_SHA}
+    - sonar-scanner -Dsonar.projectBaseDir=$(pwd) -Dsonar.projectVersion=${CI_COMMIT_SHORT_SHA}
 ```
 
 Make sure you put a `sonar-project.properties` file into the root of your repo:
-- 
GitLab