Move rewrite rules from here to their separate repositories
Current process for managing rewriting and OpenAPI docs generation
- In each haf app, we manually run a script on its SQL files (that contain embdeeded open_api docs) which generates:
- rewrites rules (nginx-format config file, one per server). These get copied over to the haf_api_node directory that is bind-mounted to an nginx server that we're using to do API rewriting. There is a separate nginx server for each api server, so each config file goes into a separate app directory in haf_api_node.
- New re-written version of the SQL files with OpenAPI JSON accessible via a method. This means each server can report its own api docs. To get these files into the proper place in the API server's repo, we manually copy the newly generated files to the correct directory.
A single swagger server is used to query any of these API servers to interact with their API.
Changes to current process
Currently there are several manual steps which we should eventually automate via CI tasks. Eventually we should have CI run rewriter script, but for now, skip this step.
So, for now:
- Run the script, copy the generated files over the old ones and commit them (we do this now).
- New step: During CI build, build a new docker image for the app-specific nginx that contains the rewrite rules. Tag this image with the same docker tag as the app's own docker(s).
- As part of the above, neither the main config file or the rewrite rules should be stored inside the haf_api_node repo anymore (i.e. we should remove these files from haf_api_node and the associated directories as well well if the directories are left empty).
Edited by Dan Notestein