rtfd/readthedocs.org — pull request #733 by ericholscher (2014-03-13 15:12:19+00:00)
Title: Docker Build Support

This is a huge refactor of the whole projects/tasks.py and doc_builder apps. The main goal was abstracting out the parts where we are actually building the documentation from everywhere else in the code.

The main parts that will be executed in Docker will be:

* setup_environment
* build_docs

The full workflow will be:

* ensure_version
* create_build
* setup_vcs
* setup_environment
* build_docs
* move_files
* finish_build

As you can see, the main workflow is that we do all the bookkeeping of the build, VCS management, and moving of files outside of the builders. This leaves the builders quite simple, which should be the goal.

The actual way we are using docker is that we are mapping the specific project's checkout_directory (/users_builds/) into the docker container. So, we setup the VCS checkout to the proper version, and then call Docker, mapping these filesystem. The builders have been refactored to put their build artifacts in ``/user_builds/artifacts//``, so that these artifacts make their way back onto the main system.

Currently this PR doesn't do any bookkeeping of docker. This means that every time we run Docker, we'll have to create the entire environment (virtualenv + requirements) for each build. My thoughts on how to handle this are still evolving. I'm thinking it might make sense to do a checkout of the docker container once the requirements have been installed. This would use something like ``docker commit - ``, which would then be the updated image used for that specific project & version combination.

The actual docker image also isn't included in this commit. I will try to clean it up and publish the DockerFile in this PR also.