Skip to content

Commit

Permalink
Catch up with latest changes in ods-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsauter committed Sep 27, 2023
1 parent 21abe9a commit 4f7464d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ help: ## Show this help screen.

##@ Building

images: image-sonar-scan ## Build images.
images: image-scan ## Build images.
.PHONY: images

image-sonar-scan: ## Build sonar-scan image.
image-scan: ## Build scan image.
docker build \
-f build/images/Dockerfile.sonar-scan \
-t localhost:5000/ods-pipeline/sonar-scan \
-f build/images/Dockerfile.scan \
-t localhost:5000/ods-pipeline/scan \
.
.PHONY: image-sonar-scan
.PHONY: image-scan

tasks: ## Render tasks. Use "VERSION=1.0.0 make tasks" to render a specific version.
go run github.com/opendevstack/ods-pipeline/cmd/taskmanifest \
Expand Down
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

# Install Sonar Scanner.
RUN apt-get update && apt-get install -y unzip \
Expand All @@ -28,12 +28,25 @@ COPY . .
RUN cd cmd/sonar && CGO_ENABLED=0 go build -o /usr/local/bin/sonar

# Final image
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
FROM registry.access.redhat.com/ubi8/nodejs-18:1

ENV NPM_CONFIG_PREFIX=$HOME/.npm-global \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

RUN echo id: $(id) && \
echo node version: $(node --version) && \
echo npm version: $(npm --version) && \
echo npx version: $(npx --version)

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

RUN microdnf install --nodocs java-11-openjdk-headless which && microdnf clean all
USER root
RUN INSTALL_PKGS="java-11-openjdk-headless which" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'

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 build/tasks/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
default: "false"
steps:
- name: scan-with-sonar
# Image is built from build/package/Dockerfile.sonar-scan.
image: '{{.ImageRepository}}/sonar-scan:{{.Version}}'
# Image is built from build/package/Dockerfile.scan.
image: '{{.ImageRepository}}/scan:{{.Version}}'
env:
- name: HOME
value: '/tekton/home'
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestMain(m *testing.M) {
func testMain(m *testing.M) int {
cc, err := ttr.StartKinDCluster(
ttr.LoadImage(ttr.ImageBuildConfig{
Dockerfile: "build/images/Dockerfile.sonar-scan",
Dockerfile: "build/images/Dockerfile.scan",
ContextDir: rootPath,
}),
)
Expand Down

0 comments on commit 4f7464d

Please sign in to comment.