Skip to content

Commit

Permalink
Fixing version in downstream builds
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierCazade committed Nov 25, 2024
1 parent e1ab699 commit 52bd167
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .tekton/pipeline-ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ spec:
value:
- $(params.build-args[*])
- "COMMIT=tasks.clone-repository.results.commit"
- "LDFLAGS=-X main.BuildVersion=1.7.1-$(tasks.clone-repository.results.commit) -X main.BuildDate=$(tasks.clone-repository.results.commit-timestamp)"
- name: BUILD_ARGS_FILE
value: $(params.build-args-file)
- name: SOURCE_ARTIFACT
Expand Down
10 changes: 8 additions & 2 deletions contrib/docker/Dockerfile.downstream
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ ARG COMMIT
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9 as builder

ARG TARGETARCH=amd64
ARG LDFLAGS
ARG VERSION
ARG DATE

WORKDIR /app

# Copy source code
Expand All @@ -17,11 +21,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=$VERSION -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
Expand All @@ -35,5 +41,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."

0 comments on commit 52bd167

Please sign in to comment.