Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar: automatically use the latest version of sonar-scanner-cli #1540

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Versions
* Golang: automatically use the latest version of included tools.
* Node: using the latest versions of Taskfile and Modd. Upgrading to Debian 12.
* PHP: using the latest versions of Taskfile and Modd
* Sonar: automatically use the latest version of sonar-scanner-cli

2024-11-30
----------
Expand Down
6 changes: 3 additions & 3 deletions sonar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ FROM alpine:3.21.2 as base
LABEL maintainer="[email protected]"

ARG SONARSCANNER_HOME=/sonar-scanner
ARG SONARSCANNER_VERSION

ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SONARSCANNER_HOME}/jre/lib/server \
LD_PRELOAD=/lib/libgcompat.so.0 \
PATH=${SONARSCANNER_HOME}/bin:${SONARSCANNER_HOME}/jre/bin:${PATH}

FROM base as base-amd64
FROM base AS base-amd64
ARG SONARSCANNER_ARCH="linux-x64"

FROM base as base-arm64
FROM base AS base-arm64
ARG SONARSCANNER_ARCH="linux-aarch64"

FROM base-$TARGETARCH
RUN echo "Starting ..." && \
apk --update upgrade && apk add curl gcompat make tzdata unzip && \
echo "Done base install!" && \
echo "Starting Sonar Scanner" && \
SONARSCANNER_VERSION=$(curl -s https://api.github.com/repos/SonarSource/sonar-scanner-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && \
curl -o ./sonarscanner.zip -L https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONARSCANNER_VERSION}-${SONARSCANNER_ARCH}.zip && \
unzip sonarscanner.zip && \
rm sonarscanner.zip && \
Expand Down
3 changes: 1 addition & 2 deletions sonar/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ versions:
platforms:
- linux/amd64
- linux/arm64
build_args:
SONARSCANNER_VERSION: 6.2.1.4610
test_config:
cmd:
- java -version
- sonar-scanner -v
- output$(sonar-scanner -v) && echo $output | grep "SonarScanner CLI 6.2"
Loading