From e6c032c000aa10f6233c6fb6e40912dc59c9e228 Mon Sep 17 00:00:00 2001 From: James Antill Date: Aug 24 2016 19:17:37 +0000 Subject: Add jenkins-check.sh to run the unit tests from docker, roughly as jenkins does. --- diff --git a/jenkins-check-Dockerfile b/jenkins-check-Dockerfile new file mode 100644 index 0000000..7f10315 --- /dev/null +++ b/jenkins-check-Dockerfile @@ -0,0 +1,23 @@ +# This is what jenkins uses to check, roughly + +FROM fedora:24 + +# so we don't have to compile those when fetched from PyPI +RUN dnf install -y python-pip python2-setuptools python2-cffi python2-zmq python2-cryptography koji python2-pdc-client && \ + dnf autoremove -y && dnf clean all && \ + mkdir /opt/fm-orchestrator/ +WORKDIR /opt/fm-orchestrator/ +COPY ./requirements.txt /opt/fm-orchestrator/ +RUN pip install --user -r ./requirements.txt + +# This isn't what we do in jenkins, blah ... +# RUN pip install --upgrade -r test-requirements.txt + +RUN pip install --upgrade mock + +# Need to force reinstall so nose gets the virtualenv modules. +RUN pip install nose --ignore-installed + +COPY . /opt/fm-orchestrator/ + +CMD ["nosetests", "."] diff --git a/jenkins-check.sh b/jenkins-check.sh new file mode 100755 index 0000000..8a91a82 --- /dev/null +++ b/jenkins-check.sh @@ -0,0 +1,4 @@ +#! /bin/sh -e + +sudo docker build -f jenkins-check-Dockerfile -t fm-orchestrator/jenkins-check-24 . +sudo docker run fm-orchestrator/jenkins-check-24