Generated HTML API documentation for the Foreman and its plugins via apipie-rails.
The content is hosted at https://apidocs.theforeman.org
For Foreman documentation go to https://docs.theforeman.org
Follow these steps to add a new version:
Fetch API docs for Foreman:
- Go to https://github.com/theforeman/foreman/actions/workflows/foreman.yml?query=branch%3AX.Y-stable
- Pick the latest run of the action
- Download the
apidoc-*artifact (there might be multiple, pick any one of them)
You can also do this from the CLI using gh:
gh run download --repo theforeman/foreman --pattern 'apidoc-*' $(gh run list --repo theforeman/foreman --workflow foreman.yml --branch X.Y-stable --status completed --limit 1 --json databaseId --jq '.[].databaseId')
Note: gh will automatically unzip the artifacts, so you only have to copy them.
Prepare folder for the new version (X.Y)
cd foremancp -r TEMPLATE X.Yln -snf X.Y latestunzip -d X.Y/apidoc ~/Downloads/apidoc-<…>.zip- run cleanup script in the root of the apidocs repo:
cleanup.sh - update index.html file with a link to the new page
Generate API docs in a Foreman + Katello development environment:
- cd to the katello directory and checkout the relevant release branch
- cd to the foreman directory and checkout the relevant stable branch
APIPIE_RECORD=examples bundle exec rake testRAILS_ENV=production FOREMAN_APIPIE_LANGS=en bundle exec rake apipie:cache
Prepare folder for the new version (X.Y)
- cd to the apidocs/katello directory
cp -r TEMPLATE X.Yln -snf X.Y latestcp -r dir/to/foreman/public/apipie-cache/apidoc/* X.Y/apidoc- run cleanup script in apidocs repo:
cleanup.sh - update index.html file with a link to the new page
All files are auto-generated and distributed under GNU GPL v3 conditions. See the LICENSE file for more info.