Skip to content

Commit e31d74f

Browse files
Merge pull request #1 from ankitathomas/fix-commit-ID
add openshift specific build target to pass commit info downstream
2 parents cba3e69 + 2a5b3b8 commit e31d74f

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

openshift/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,8 @@ test-e2e: ## Run the e2e tests.
3737
$(DIR)/operator-controller/build-test-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME) $(E2E_REGISTRY_IMAGE)
3838
cd $(DIR)/../; \
3939
go test $(DOWNSTREAM_E2E_FLAGS) ./test/e2e/...;
40+
41+
export GIT_COMMIT := ${SOURCE_GIT_COMMIT}
42+
PHONY: go-build-local
43+
go-build-local:
44+
$(MAKE) -n -f Makefile go-build-local

openshift/catalogd.Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder
22

3-
ENV GIT_COMMIT=${SOURCE_GIT_COMMIT}
4-
53
WORKDIR /build
64
COPY . .
7-
RUN make go-build-local
5+
RUN make -f openshift/Makefile go-build-local
86

97
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9
108
USER 1001

openshift/operator-controller.Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder
22

3-
ENV GIT_COMMIT=${SOURCE_GIT_COMMIT}
4-
53
WORKDIR /build
64
COPY . .
7-
RUN make go-build-local
5+
RUN make -f openshift/Makefile go-build-local
86

97
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9
108
USER 1001

openshift/registry.Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder
22

3-
ARG SOURCE_GIT_COMMIT
4-
ENV GIT_COMMIT=${SOURCE_GIT_COMMIT}
5-
63
WORKDIR /build
74
COPY . .
85
# TODO Modify upstream Makefile to separate the 'go build' commands

0 commit comments

Comments
 (0)