diff --git a/.tekton/pipeline-ref.yaml b/.tekton/pipeline-ref.yaml index 9f9a20e65..77f3e1fdf 100644 --- a/.tekton/pipeline-ref.yaml +++ b/.tekton/pipeline-ref.yaml @@ -196,7 +196,9 @@ spec: - name: BUILD_ARGS value: - $(params.build-args[*]) - - "COMMIT=tasks.clone-repository.results.commit" + - "COMMIT=$(tasks.clone-repository.results.commit)" + - "BUILDVERSION=1.7.1" + - "DATE=$(tasks.clone-repository.results.commit-timestamp)" - name: BUILD_ARGS_FILE value: $(params.build-args-file) - name: SOURCE_ARTIFACT diff --git a/contrib/docker/Dockerfile.downstream b/contrib/docker/Dockerfile.downstream index 05a580e54..87aee8a58 100644 --- a/contrib/docker/Dockerfile.downstream +++ b/contrib/docker/Dockerfile.downstream @@ -3,6 +3,9 @@ ARG COMMIT FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9 as builder ARG TARGETARCH=amd64 +ARG BUILDVERSION +ARG DATE + WORKDIR /app # Copy source code @@ -17,11 +20,13 @@ COPY cmd/ cmd/ COPY pkg/ pkg/ RUN git status --porcelain -RUN GOARCH=$TARGETARCH make build_code +RUN GOARCH=$TARGETARCH go build -ldflags "-X main.BuildVersion=$BUILDVERSION -X main.BuildDate=$DATE" "./cmd/flowlogs-pipeline" # final stage FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.5 +ARG COMMIT + COPY --from=builder /app/flowlogs-pipeline /app/ # expose ports @@ -35,5 +40,5 @@ LABEL summary="Network Observability Flow-Logs Pipeline" LABEL maintainer="support@redhat.com" LABEL io.openshift.tags="network-observability-flowlogs-pipeline" LABEL upstream-vcs-type="git" -LABEL upstream-vcs-type="$COMMIT" +LABEL upstream-vcs-ref="$COMMIT" LABEL description="Flow-Logs Pipeline (a.k.a. FLP) is an observability tool that consumes logs from various inputs, transform them and export logs to loki and / or time series metrics to prometheus."