Search code examples
gitlabpython-sphinxread-the-docsgitlab-ce

Using GitLab + Read the Docs for documentation on a Private VM: RTD build fails


Background

I am a technical writer trying to use Read the Docs to generate documentation for one of our product. As we have a non-disclosure agreement for any publication, I have to host the documentation on a virtual machine for customers with intranet access to read.

Installation

GitLab

My VM is a CentOS 8. I installed GitLab Community Edition through Docker. I created a repository for my Markdown source code under the root account, the address of the repo being http://${vm_address}/root/${repo_name}. The GitLab container runs on Port 20 of my VM.

Read the Docs

As RTD does not officially support On-premise deployment, I pulled an unofficial image from Docker. See vassilvk/readthedocs. This RTD container runs on Port 8000 of my VM. I use username "admin" to log into RTD.

Procedure I Took to Integrate GitLab and RTD

To import the source code in my GitLab, I did the following:

  1. On the Project page, click Import a Project.
  2. Click Import Manually on the left panel.
  3. In the Project Details page, fill in the fields as follows:
    • Project name: ${my_project_name}
    • Repository URL: ${Clone_With_HTTP_Address} I copied the URL from the "Clone with HTTP" field under the Clone button dropdown in GitLab
    • Repository Type: Git
  4. In the Advanced Project Options, I set Documentation Type to Sphinx HTML.
  5. Click Finish.

Result

The build fails with error code 1.

Failed RTD Build

Question

  • Where did I do wrong with the RTD project settings?
  • Is something wrong going on with my RTD or GitLab container settings?
  • Do I still need to install Sphinx on the VM?

Solution

  • As we have a non-disclosure agreement for any publication, I have to host the documentation

    This does not follow at all. You must be looking at the wrong ReadTheDocs. There are two sites:

    1. ReadTheDocs.org - that one is the free, publicly visible hosting.
    2. ReadTheDocs.com - that's the one you want, it hosts private repositories for businesses exactly like yours.

    Unless you're in a well managed, secure IT environment, running random Docker images on your own VM will almost certainly lead to inadvertent disclosure. Are you in hosting business? No. Don't play a hosting business when all you want is to write some private documentation. There are products for that.