diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..d768695d89 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +*.py[co] +*.sw[po] +libcloud/test/secrets.py +demos/secrets.py +*~ +.tox +_trial_temp +build +MANIFEST +/.ropeproject/config.py +/.coverage +coverage_html_report/ +.idea +dist/*apache-libcloud* +dist/*apache_libcloud* +docs/apidocs/* +_build/ +apache_libcloud.egg-info/ +.project +.pydevproject +.settings +.git* +Dockerfile* diff --git a/contrib/Dockerfile b/contrib/Dockerfile new file mode 100644 index 0000000000..57f27bb18b --- /dev/null +++ b/contrib/Dockerfile @@ -0,0 +1,38 @@ +FROM ubuntu:14.04 + +RUN set -e && \ + apt-get update && \ + apt-get install -y \ + software-properties-common \ + wget \ + ssh && \ + add-apt-repository ppa:fkrull/deadsnakes && \ + apt-get update && \ + apt-get -y install \ + python2.6 \ + python2.7 \ + python3.2 \ + python3.3 \ + python3.4 \ + python-dev \ + python2.6-dev \ + python2.7-dev \ + python3.2-dev \ + python3.3-dev \ + python3.4-dev \ + python-pip + +RUN set -e && \ + wget https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux64.tar.bz2 && \ + tar xf ./pypy-2.5.0-linux64.tar.bz2 -C /opt && \ + ln -s /opt/pypy-2.5.0-linux64/bin/pypy /usr/local/bin/pypy + +RUN set -e && \ + pip install tox \ + mock \ + lockfile \ + coverage + +COPY . /libcloud +WORKDIR /libcloud +CMD tox diff --git a/contrib/run_tests.sh b/contrib/run_tests.sh new file mode 100755 index 0000000000..dc7efa341d --- /dev/null +++ b/contrib/run_tests.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# The script needs docker to be installed. +# +# Script which builds a testing docker image and container, +# install the necessary packages: pypy, pip, python versions +# 2.6, 2.7, 3.2, 3.3, 3.4 (corresponding dev packages as well) +# and run the tox tests within the container. +# The script has to be run from libcloud root. + +set -e +docker build -f contrib/Dockerfile -t libcloud_runtest_img . +docker run --rm --name libcloud_runtest_instance libcloud_runtest_img diff --git a/tox.ini b/tox.ini index e612f5f6bd..cb05e438b4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py25,py26,py27,pypy,py32,py33,py34,lint +envlist = py26,py27,pypy,py32,py33,py34,lint setenv = PIP_USE_MIRRORS=1