diff mbox series

[ovs-dev,3/4] CI: Add argument for the py-requirements path

Message ID 20230314105324.127218-4-amusil@redhat.com
State Changes Requested
Headers show
Series Add automation to automatically build containers | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil March 14, 2023, 10:53 a.m. UTC
In order to build the container from different
working directory we need to properly specify the path
to py-requirements.txt. Add ARG into the Dockerfile
and into Makefile which allows us to specify the path.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 utilities/containers/Makefile          | 5 ++++-
 utilities/containers/fedora/Dockerfile | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

0-day Robot March 14, 2023, 12:01 p.m. UTC | #1
Bleep bloop.  Greetings Ales Musil, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line has non-spaces leading whitespace
#31 FILE: utilities/containers/Makefile:9:
	$(CONTAINER_CMD) build --no-cache --rm -t $(IMAGE_NAME) \

WARNING: Line has non-spaces leading whitespace
#32 FILE: utilities/containers/Makefile:10:
	-f $(DISTRO)/Dockerfile . --build-arg=CONTAINERS_PATH=$(CONTAINERS_PATH)

Lines checked: 57, Warnings: 2, Errors: 0


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/utilities/containers/Makefile b/utilities/containers/Makefile
index 8b39e3493..ef1d42aca 100644
--- a/utilities/containers/Makefile
+++ b/utilities/containers/Makefile
@@ -1,7 +1,10 @@ 
 CONTAINER_CMD ?= podman
 DISTRO ?= fedora
 IMAGE_NAME ?= "ovn-org/ovn-tests"
+CONTAINERS_PATH ?= "."
 
 .PHONY: build
 
-build: ;$(CONTAINER_CMD) build --no-cache --rm -t $(IMAGE_NAME) -f $(DISTRO)/Dockerfile .
+build:
+	$(CONTAINER_CMD) build --no-cache --rm -t $(IMAGE_NAME) \
+	-f $(DISTRO)/Dockerfile . --build-arg=CONTAINERS_PATH=$(CONTAINERS_PATH)
diff --git a/utilities/containers/fedora/Dockerfile b/utilities/containers/fedora/Dockerfile
index 4212e2d76..4058d7f5b 100755
--- a/utilities/containers/fedora/Dockerfile
+++ b/utilities/containers/fedora/Dockerfile
@@ -1,5 +1,7 @@ 
 FROM quay.io/fedora/fedora:latest
 
+ARG CONTAINERS_PATH
+
 # Update distro, install packages and clean any possible leftovers
 RUN dnf -y update \
     && \
@@ -52,7 +54,7 @@  RUN git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git \
 
 WORKDIR /workspace
 
-COPY py-requirements.txt /tmp/py-requirements.txt
+COPY $CONTAINERS_PATH/py-requirements.txt /tmp/py-requirements.txt
 
 # Update and install pip dependencies
 RUN python3 -m pip install --upgrade pip \