0

I have an open source API server project on Github and I am trying to put it into continous integration. The project uses SQL Alchemy and I use ELAlchemy to manually generate a png database relationship graph (in png format) and put it into my documentation (in .rst format and uploaded to Read the Docs).

Now I am using Travis CI, I am wondering whether I can copy the png file from my Travis CI build result and put into Read the Docs, so that I no longer need to generate the ER diagram manually.

1 Answers1

1

Generating documentation as part of your build pipeline is definitely an idea worth considering.

Conceptually, here's how you could do it:

  1. install ERAlchemy on Travis using a regular pip install eralchemy
  2. generate your diagram during your build
  3. upload the rendered diagram to a publicly available URL (rsync to a file server, upload to AWS S3, whatever you prefer)
  4. in your .rst documentation, you embed the ER diagram as an image using the URL of the uploaded file

This way, the documentation will always show the latest version of your diagram. Beware that this might come with its own drawbacks. If you automatically update your diagrams without updating the documentation that might be referencing that diagram, things might get confusing for your readers.

Ham Vocke
  • 2,477