diff --git a/.travis.yml b/.travis.yml index 1ce9b92..958f5f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,5 @@ script: make build deploy: provider: script script: _scripts/ci/deploy.sh + on: + tags: true diff --git a/README.md b/README.md index 701201a..5dbb56a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,53 @@ -# docker-python-dev -[![Build Status](https://travis-ci.org/deis/docker-python-dev.svg?branch=master)](https://travis-ci.org/deis/docker-python-dev) +# deis/python-dev -A containerized development environment to support building Python-based Deis v2 components http://deis.com +[![Build Status](https://travis-ci.org/deis/docker-python-dev.svg?branch=master)](https://travis-ci.org/deis/docker-python-dev) [![Docker Repository on Quay](https://quay.io/repository/deis/python-dev/status "Docker Repository on Quay")](https://quay.io/repository/deis/python-dev) + +A [Python 3][] language development toolbox. + +Some [Deis Workflow][] components use this Docker image as a standard build and test environment, +but it is intended to be useful to any Python developer. Please help make deis/python-dev better by +creating [issues][] and submitting [pull requests][]. + +## Image Contents + +* [codecov][]: uploader for codecov.io coverage reports +* [coverage][]: measures code coverage for Python programs +* [flake8][]: modular source code linter, including pep8, pyflakes and mccabe +* [Python 3.5.2][Python 3] + +## Usage + +Mount your local Python code into the container to run one of the included tools or scripts. +Here's an example of running `flake8` for deis/dockerbuilder: + +```console +$ docker run --rm \ + --volume `pwd`/rootfs:/app \ + --workdir /app \ + quay.io/deis/python-dev:latest \ + flake8 --show-source --config=setup.cfg . +``` + +The latest deis/python-dev Docker image is available at: + +* [Quay.io][] + ``` + docker pull quay.io/deis/python-dev + ``` + +* [Docker Hub][] + ``` + docker pull deis/python-dev + ``` + +[Python 3]: https://docs.python.org/3.5/ +[Deis Workflow]: https://deis.com/ +[Docker Hub]: https://hub.docker.com +[issues]: https://github.com/deis/docker-python-dev/issues +[jq]: https://stedolan.github.io/jq/ +[pull requests]: https://github.com/deis/docker-python-dev/pulls +[codecov]: https://codecov.io/ +[coverage]: https://coverage.readthedocs.io +[flake8]: https://gitlab.com/pycqa/flake8 +[Quay.io]: https://quay.io +[shellcheck]: https://github.com/koalaman/shellcheck diff --git a/_scripts/ci/deploy.sh b/_scripts/ci/deploy.sh index c62e0e3..e12bc15 100755 --- a/_scripts/ci/deploy.sh +++ b/_scripts/ci/deploy.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash - docker login -e "$DOCKER_EMAIL" -u "$DOCKER_USER" -p "$DOCKER_PASSWORD" REGISTRY="" make push docker login -e "$QUAY_EMAIL" -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 3567292..cb0b1e6 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -1,7 +1,9 @@ -FROM python:3.5-alpine +FROM quay.io/deis/base:v0.3.6 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + python3-pip + +COPY . / + +RUN pip3 install --disable-pip-version-check --no-cache-dir -r dev_requirements.txt -RUN pip install \ - coverage==4.0.3 \ - codecov==1.6.3 \ - flake8==2.5.4 \ - requests-mock==0.7.0 diff --git a/rootfs/dev_requirements.txt b/rootfs/dev_requirements.txt new file mode 100644 index 0000000..a7dfeaa --- /dev/null +++ b/rootfs/dev_requirements.txt @@ -0,0 +1,3 @@ +codecov==2.0.5 +coverage==4.3.4 +flake8==3.3.0