From 0998608bd456d0a670b299b3cd0b31817de886b1 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Apr 03 2019 14:21:59 +0000 Subject: allow overwriting default repo --- diff --git a/dev/containers/centos7-rpms-py2 b/dev/containers/centos7-rpms-py2 index 472e36d..40fe373 100644 --- a/dev/containers/centos7-rpms-py2 +++ b/dev/containers/centos7-rpms-py2 @@ -1,5 +1,11 @@ FROM centos:7 +ARG repo +ARG branch + +ENV REPO=$repo +ENV BRANCH=$branch + RUN yum -y install \ epel-release @@ -26,7 +32,7 @@ RUN yum -y install \ RUN yum install -y https://pingou.fedorapeople.org/RPMs/python-werkzeug-0.9.6-1.el7.noarch.rpm RUN cd / \ - && git clone https://pagure.io/pagure.git \ + && git clone -b $BRANCH $REPO \ && chmod +x /pagure/dev/containers/runtests_py2.sh # Install all the requirements from the spec file and replace the macro diff --git a/dev/containers/f29-rpms-py3 b/dev/containers/f29-rpms-py3 index 6eea880..f061d3d 100644 --- a/dev/containers/f29-rpms-py3 +++ b/dev/containers/f29-rpms-py3 @@ -1,5 +1,11 @@ FROM fedora:29 +ARG repo +ARG branch + +ENV REPO=$repo +ENV BRANCH=$branch + RUN dnf -y install \ python3-setuptools \ python3-coverage \ @@ -14,7 +20,7 @@ RUN dnf -y install \ # FIXME: this should use $REPO and $BRANCH: RUN cd / \ - && git clone https://pagure.io/pagure.git \ + && git clone -b $BRANCH $REPO \ && chmod +x /pagure/dev/containers/runtests_py3.sh # Install all the requirements from the spec file and replace the macro diff --git a/dev/containers/fedora-pip-py3 b/dev/containers/fedora-pip-py3 index 6f4c1b7..d50ec7b 100644 --- a/dev/containers/fedora-pip-py3 +++ b/dev/containers/fedora-pip-py3 @@ -1,5 +1,11 @@ FROM fedora:latest +ARG repo +ARG branch + +ENV REPO=$repo +ENV BRANCH=$branch + RUN dnf -y install \ python3-setuptools \ redhat-rpm-config \ @@ -15,7 +21,7 @@ RUN dnf -y install \ git RUN cd / \ - && git clone https://pagure.io/pagure.git \ + && git clone -b $BRANCH $REPO \ && chmod +x /pagure/dev/containers/tox_py3.sh # Install pygit2 manually, outside of the virtualenv since it is tightly coupled diff --git a/dev/run-tests-container.py b/dev/run-tests-container.py index 489f2da..2793a26 100755 --- a/dev/run-tests-container.py +++ b/dev/run-tests-container.py @@ -74,6 +74,10 @@ if __name__ == "__main__": [ "podman", "build", + "--build-arg", + "branch={}".format(os.environ.get("BRANCH") or "master"), + "--build-arg", + "repo={}".format(os.environ.get("REPO") or "https://pagure.io/pagure.git"), "--rm", "-t", container_name, @@ -103,9 +107,9 @@ if __name__ == "__main__": "{}/results_{}:/pagure/results:z".format( os.getcwd(), container_files[idx]), "-e", - "BRANCH=$BRANCH", + "BRANCH={}".format(os.environ.get("BRANCH") or "master"), "-e", - "REPO=$REPO", + "REPO={}".format(os.environ.get("REPO") or "https://pagure.io/pagure.git"), "--entrypoint=/bin/bash", container_name, ] @@ -123,9 +127,9 @@ if __name__ == "__main__": "{}/results_{}:/pagure/results:z".format( os.getcwd(), container_files[idx]), "-e", - "BRANCH={}".format(os.environ.get("BRANCH") or ""), + "BRANCH={}".format(os.environ.get("BRANCH") or "master"), "-e", - "REPO={}".format(os.environ.get("REPO") or ""), + "REPO={}".format(os.environ.get("REPO") or "https://pagure.io/pagure.git"), "-e", "TESTCASE={}".format(args.test_case or ""), container_name,