Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit c1a0786

Browse files
committed
sonar image needs node
1 parent d95061e commit c1a0786

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ listed in the changelog.
2121

2222
- update sonar-scanner and cnes-report ([#725](https://github.com/opendevstack/ods-pipeline/issues/725))
2323

24+
- SonarQube doesn't scan FE-related code ([#716](https://github.com/opendevstack/ods-pipeline/issues/716))
2425

2526
## [0.13.2] - 2023-07-18
2627

build/package/Dockerfile.sonar

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,25 @@ RUN cd /tmp \
3131
&& chmod +x /usr/local/cnes/cnesreport.jar
3232

3333
# Final image
34-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
34+
FROM registry.access.redhat.com/ubi8/nodejs-18:1
35+
36+
ENV NPM_CONFIG_PREFIX=$HOME/.npm-global \
37+
LANG=en_US.UTF-8 \
38+
LC_ALL=en_US.UTF-8
39+
40+
RUN echo id: $(id) && \
41+
echo node version: $(node --version) && \
42+
echo npm version: $(npm --version) && \
43+
echo npx version: $(npx --version)
3544

3645
ENV SONAR_EDITION="community" \
3746
JAVA_HOME=/usr/lib/jvm/jre-11
3847

39-
RUN microdnf install --nodocs java-11-openjdk-headless tzdata-java which && microdnf clean all
40-
# tzdata-java was missing unless explicitly installed: see https://stackoverflow.com/a/76848186
48+
USER root
49+
RUN INSTALL_PKGS="java-11-openjdk-headless which" && \
50+
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
51+
rpm -V $INSTALL_PKGS && \
52+
yum -y clean all --enablerepo='*'
4153

4254
COPY --from=builder /usr/local/bin/sonar /usr/local/bin/sonar
4355
COPY --from=builder /usr/local/sonar-scanner-cli /usr/local/sonar-scanner-cli

docs/design/software-design-specification.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ As described in the architecture, the system is installed into local namespaces.
2828
|===
2929
| SDS-SHARED-1
3030
| `ods-sonar` container image
31-
| Container image for SQ scanning. Based on `ubi8/ubi-minimal` (SDS-EXT-2), includes software to analyze source code statically (SDS-SHARED-2, SDS-EXT-7, SDS-EXT-8 and SDS-EXT-30).
31+
| Container image for SQ scanning. Based on `ubi8/nodejs-18` (SDS-EXT-32), includes software to analyze source code statically (SDS-SHARED-2, SDS-EXT-7, SDS-EXT-8 and SDS-EXT-30).
3232

3333
| SDS-SHARED-2
3434
| `sonar` binary
@@ -380,7 +380,7 @@ If the Aqua scanner is installed in the base image, the pushed image shall be sc
380380

381381
Processes tags specified in the `extra-tags` parameter to add tags to the image in the target registry:
382382

383-
* If an artifact for the tagged image exists, the tag is not further processed.
383+
* If an artifact for the tagged image exists, the tag is not further processed.
384384
* If there is no artifact for the tagged image:
385385
* Adds the tag using skopeo (SDS-EXT-17) to the image in the target registry.
386386
* The resulting tagged image artifact is placed into `.ods/artifacts`.

0 commit comments

Comments
 (0)