We are migrating Jenkins jobs to simply invokes test entry points (ex: composer test, npm test). More and more repositories are willing to have documentation generated and published to https://doc.wikimedia.org/ . The problem is that each repository ended up with its own set of command which causes us to have a job per repository. Some examples:
|Python projects||tox -edocs|
|MediaWiki||custom script around maintenance/mwdocgen.php|
We could reuse the test utilities (tox, npm, composer ..) but some repositories have documentations in different languages (jsduck / sphinx / whatever) which we will want to generate together for publishing.
Maybe we could establish the convention of using a MakeFile. It is simple enough to write and can shell out to whatever underlying command people might want to use (ex: make doc).
Finally, docs are generated to arbitrary paths ( docs/, build/docs, .docs/html, /html/docs ...). The Jenkins template has support to specify the directory to copy from. Ultimately it would be nice to agree on a convention, a simple one would be to have the make doc script to recognize an env variable containing the doc destination (ex: WMF_CI_DOC_OUTPUT), which will make all Jenkins jobs the same.