diff --git a/.gitignore b/.gitignore index 1379c61..811f030 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ bin include lib local +hacking/*/tito.spec diff --git a/hacking/runtests.sh b/hacking/runtests.sh index 0dffd75..7eaf81b 100755 --- a/hacking/runtests.sh +++ b/hacking/runtests.sh @@ -86,8 +86,15 @@ header() { build_image() { name=$1 header $name + # Use hard link + gitignore as workaround for + # https://github.com/dotcloud/docker/issues/1676 + # Do not use... + # symlink: not available when building image + # cp: invalidates docker build cache + ln -f tito.spec hacking/$name/ pushd hacking/$name && echo $PWD && docker build --rm -t $name . popd + rm -f hacking/$name/tito.spec } run_inside_image() { diff --git a/hacking/titotest-centos-5.9/Dockerfile b/hacking/titotest-centos-5.9/Dockerfile index 6e2746e..32661af 100644 --- a/hacking/titotest-centos-5.9/Dockerfile +++ b/hacking/titotest-centos-5.9/Dockerfile @@ -5,6 +5,8 @@ FROM tianon/centos:5.9 MAINTAINER Paul Morgan # Install dependencies. +# It would be nice to use yum-builddep, but +# el5 yum-builddep only works against rpm, not spec file. RUN rpm -Uvh http://mirror.es.its.nyu.edu/epel/5/x86_64/epel-release-5-4.noarch.rpm RUN yum -y install git rpm-build \ python-devel python-nose python-setuptools python-pep8 \ diff --git a/hacking/titotest-centos-6.4/Dockerfile b/hacking/titotest-centos-6.4/Dockerfile index 3faca1c..d4b342b 100644 --- a/hacking/titotest-centos-6.4/Dockerfile +++ b/hacking/titotest-centos-6.4/Dockerfile @@ -4,14 +4,28 @@ FROM centos:6.4 # http://jumanjiman.github.io/ MAINTAINER Paul Morgan -# Install dependencies. -RUN yum -y install git rpm-build python-devel python-nose \ - libxslt asciidoc python-setuptools tar createrepo which -RUN rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm -RUN yum -y install python-pep8 git-annex python-mock python-bugzilla +# NOTE: runtests.sh hard-links tito.spec into this directory on-the-fly +# to work around https://github.com/dotcloud/docker/issues/1676 +ADD tito.spec /tmp/tito.spec -# Remove yum metadata. -RUN yum clean all +# Install build dependencies. +RUN yum -y install yum-utils \ + ; yum-builddep -y /tmp/tito.spec \ + ; yum clean all + +# Install test dependencies. It would be nice to add these as +# build deps and add %check to tito.spec in accordance with +# https://fedoraproject.org/wiki/QA/Testing_in_check +# but some of the packages come from EPEL. +RUN rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm +RUN yum -y install \ + git \ + git-annex \ + python-bugzilla \ + python-mock \ + python-nose \ + python-pep8 \ + ; yum clean all RUN useradd sandbox RUN git config --global user.email "sandbox@example.com" diff --git a/hacking/titotest-fedora-20/Dockerfile b/hacking/titotest-fedora-20/Dockerfile index 8067d91..93e3b4e 100644 --- a/hacking/titotest-fedora-20/Dockerfile +++ b/hacking/titotest-fedora-20/Dockerfile @@ -7,16 +7,14 @@ MAINTAINER Paul Morgan # F20 needs updates to resolve conflict with asciidoc. RUN yum -y update; yum clean all -# Install dependencies. -RUN yum -y install git rpm-build libxslt tar \ - asciidoc \ - python-devel python-nose python-setuptools python-pep8 \ - python-mock \ - python3-devel python3-nose python3-setuptools python3-pep8 rpm-python3 python3-mock \ - createrepo git-annex which python-bugzilla python3-bugzilla +# NOTE: runtests.sh hard-links tito.spec into this directory on-the-fly +# to work around https://github.com/dotcloud/docker/issues/1676 +ADD tito.spec /tmp/tito.spec -# Remove yum metadata. -RUN yum clean all +# Install build dependencies. +RUN yum -y install yum-utils \ + ; yum-builddep -y /tmp/tito.spec \ + ; yum clean all RUN useradd sandbox RUN git config --global user.email "sandbox@example.com" diff --git a/tito.spec b/tito.spec index 742e017..9d5309b 100644 --- a/tito.spec +++ b/tito.spec @@ -18,6 +18,31 @@ BuildRequires: asciidoc BuildRequires: docbook-style-xsl BuildRequires: libxslt BuildRequires: rpmdevtools +BuildRequires: rpm-build +BuildRequires: createrepo +BuildRequires: tar +BuildRequires: which + +%if 0%{?fedora} >= 20 +# todo: add %check to spec file in accordance with +# https://fedoraproject.org/wiki/QA/Testing_in_check +BuildRequires: git +BuildRequires: git-annex +BuildRequires: python-bugzilla +BuildRequires: python-mock +BuildRequires: python-nose +BuildRequires: python-pep8 +%endif + +%if 0%{?fedora} >= 20 +BuildRequires: python3-mock +BuildRequires: python3-nose +BuildRequires: python3-pep8 +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-bugzilla +BuildRequires: rpm-python3 +%endif Requires: python-setuptools Requires: python-bugzilla