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

on arm64 run local sonarqube with latest LTS 9 #712

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ listed in the changelog.

- sonar-scanner invocations stderr not captured ([#719](https://github.com/opendevstack/ods-pipeline/issues/719))

- run-sonarqube.sh typically not working on apple silicon ([#711](https://github.com/opendevstack/ods-pipeline/issues/711))

## [0.13.2] - 2023-07-18

### Fixed
Expand Down
7 changes: 4 additions & 3 deletions build/package/Dockerfile.sonar
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
WORKDIR /usr/src/app

ENV SONAR_SCANNER_VERSION=4.6.2.2472 \
CNES_REPORT_VERSION=4.0.0
ENV SONAR_SCANNER_VERSION=4.8.0.2856 \
CNES_REPORT_VERSION=4.2.0
henrjk marked this conversation as resolved.
Show resolved Hide resolved

# Build Go binary.
COPY go.mod .
Expand Down Expand Up @@ -36,7 +36,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
ENV SONAR_EDITION="community" \
JAVA_HOME=/usr/lib/jvm/jre-11

RUN microdnf install --nodocs java-11-openjdk-headless which && microdnf clean all
RUN microdnf install --nodocs java-11-openjdk-headless tzdata-java which && microdnf clean all
# tzdata-java was missing unless explicitly installed: see https://stackoverflow.com/a/76848186

COPY --from=builder /usr/local/bin/sonar /usr/local/bin/sonar
COPY --from=builder /usr/local/sonar-scanner-cli /usr/local/sonar-scanner-cli
Expand Down
4 changes: 2 additions & 2 deletions docs/design/software-design-specification.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,13 @@ a| The script installs the Helm chart located in `deploy/ods-pipeline`. Further,

| SDS-EXT-7
| sonar-scanner
| 4.6
| 4.8
| General purpose SonarQube scanner
| https://github.com/SonarSource/sonar-scanner-cli

| SDS-EXT-8
| cnes-report
| 4.0
| 4.2
| Exports code analysis from a SonarQube server in various file formats.
| https://github.com/cnescatlab/sonar-cnes-report

Expand Down
2 changes: 1 addition & 1 deletion scripts/run-sonarqube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if [ "$(uname -m)" = "arm64" ]; then
rm -rf docker-sonarqube || true
git clone https://github.com/SonarSource/docker-sonarqube
cd docker-sonarqube
git checkout refs/tags/9.7.0 # Last available Git tag
git checkout refs/tags/9.9.1 # Last available Git tag
cd 9/community
docker build -t sonarqube-arm:${SONAR_IMAGE_TAG} .
cd "${SCRIPT_DIR}"/sonarqube
Expand Down
5 changes: 5 additions & 0 deletions scripts/sonarqube/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
ARG from=""
FROM $from

USER root
ENV SQ_CONF_DIR="/opt/sonarqube/conf"
RUN chmod -R ugo+wrX "${SQ_CONF_DIR}"

USER sonarqube
RUN echo "sonar.forceAuthentication=true" >> conf/sonar.properties

# Uncomment the following line to see debug output, e.g. in case SonarQube is
Expand Down
Loading