Continuous Integration for Docker & Vagrant builds
#42 opened on Feb 16, 2016
Description
Given both the rapid growth of this project and general convenience, I think a Continuous Integration solution is in order. It would help everyone by:
- showing the end-user in the README if the current
masterbuilds (which it should!), - checking every PR if it builds correctly, and informing the requester if it didn't,
- not allowing a merge of a failed PR (configurable).
Further this should take at least some burden off of @danielquinn's shoulders since a baseline check will already have been performed on the submitted changes.
From what I've seen, Travis CI seems to be the de facto standard on GitHub for automatically building open-source projects for free. There are some alternatives (like drone.io) but they usually don't allow us to install our requirements (like ImageMagick) or have other limitations. While a system like Jenkins could definitely cover all use cases, and I use it personally with great success, it requires a dedicated system to run on.
Travis CI is controlled by a .travis.yml file which has to be located in the root of the repository. This file is a specification for Travis on what steps to perform and what commands to execute in order to build and test an application. The build-environment can be a full VM based on Ubuntu 12.04 or Ubuntu 14.04 or it can be container-based.
I have created a simple .travis.yml to test if and how it works, see feature/travis-ci. I have managed to build Paperless successfully. This build was based on my Docker implementation feature/dockerfile and tested both the building of the Docker image and running of the tests under both Python 3.4 and 3.5.
Building and testing the application directly in the Travis VM without using Docker is of course possible, and Travis allows to test multiple Python-versions automatically. But (a) from what I've seen combining the Travis Python tests with the Docker tests is a hassle and (b) the environment we build up within the Docker container is identical to the one we would build up in the VM.
Ignoring the Dockerfile altogether is of course an option. While this would simplify installing and testing directly in the Travis VM, it would not guarantee that a pull request doesn't break the Dockerfile, which in my eyes should be covered by CI! (Even testing Vagrant seems to be an option.)
Summarized, those seem to be the points for discussion:
- Should a CI system be introduced?
- What exactly are the requirements for the CI?
- Is Travis CI a decent choice? Are there better alternatives?
- Do we want to cover the
DockerfileandVagrantfile?