centos7-rpms-py2 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. FROM registry.centos.org/centos/centos:7
  2. ARG repo=https://pagure.io/pagure.git
  3. ARG branch=master
  4. ENV REPO=$repo
  5. ENV BRANCH=$branch
  6. RUN yum -y install \
  7. epel-release
  8. ADD ./fedora-infra-tags.repo /etc/yum.repos.d/infra-tags.repo
  9. ADD ./fedora-infra-tags-stg.repo /etc/yum.repos.d/infra-tags-stg.repo
  10. RUN yum -y install \
  11. yum-utils \
  12. rpm-build \
  13. python-setuptools \
  14. python-coverage \
  15. python-mock \
  16. python-docutils \
  17. python-enum \
  18. python-flask \
  19. python-flake8 \
  20. python2-pytest-xdist \
  21. redis \
  22. which \
  23. git
  24. # git \
  25. # repoSpanner \
  26. # repoSpanner-bridge
  27. RUN cd / \
  28. && GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone -b $BRANCH $REPO \
  29. && chmod +x /pagure/dev/containers/runtests_py2.sh
  30. # Install all the requirements from the spec file and replace the macro
  31. # %{python_pkgversion} by empty string which thus installs all the py2
  32. # version of the dependencies.
  33. RUN cd /pagure && \
  34. yum install --enablerepo=epel-testing -y \
  35. `rpmspec -q --requires /pagure/files/pagure.spec | \
  36. sed -e "s|%{python_pkgversion}||"` && \
  37. yum clean all && \
  38. localedef -i en_US -f UTF-8 en_US.UTF-8
  39. # The old version of setuptools in CentOS7 does not support restrictions on
  40. # the requirements file, so drop them
  41. RUN \
  42. sed -i -e "s|;python_version<\"3.4\"||" /pagure/requirements.txt && \
  43. sed -i -e "s|;python_version<=\"2.7\"||" /pagure/requirements.txt && \
  44. sed -i -e "s|python3-openid;python_version>=\"3.0\"||" \
  45. /pagure/requirements.txt && \
  46. sed -i "/^email_validator.*/d" /pagure/requirements.txt && \
  47. sed -i -e 's|"alembic-3"|"alembic"|' /pagure/tests/test_alembic.py && \
  48. cd /pagure && python setup.py build
  49. WORKDIR /pagure
  50. ENTRYPOINT ["/pagure/dev/containers/runtests_py2.sh"]
  51. CMD []