.. Copyright © 2020, Eron Hennessey (Abstrys) ######################################################## Creating a Sphinx Documentation Builder with |codebuild| ######################################################## |codebuild|_ is an AWS service that manages software builds and automated testing. It can also be utilized to create a Sphinx_ documentation builder that, in conjunction with |codepipeline|_, can become part of a complete system to automatically publish documentation source changes to a live website. |codebuild| can build your source from files that exist in |codecommit|_, |s3|_, GitHub_, or on Bitbucket_. In this example, I'll be using |codecommit|. How documentation is built with Sphinx ====================================== Sphinx builds documentation with the command-line :command:`sphinx-build` program, similarly to this: .. parsed-literal:: sphinx-build -b :samp:`{ }` Many users of Sphinx will run this directly on their local system, but what if I wanted to automate the process so that any changes to my repository will be automatically built and published to my website, and perhaps to even run tests on the source or documentation source files? What are the build requirements? ================================ To design a remote build, I'll need to first think about what is required to run :command:`sphinx-build`, as well as any Sphinx extensions that I may want to use in my documentation set. :command:`sphinx-build` has the following requirements: To run in |codebuild|, I'll need to make sure that I can create a build environment that includes all of the necessary bits to run my build. The complete list of build environments provided by |codebuild| is listed in :codebuildug:`Docker Images Provided by CodeBuild ` in the *CodeBuild User Guide*. Create a docker image ===================== :: docker pull amazonlinux Create a CodeBuild build project ================================ Using the AWS CLI:: aws codebuild create-project --name myproject