Refs #4478 - prebuild localized apipie cache

Requires https://github.com/theforeman/foreman/pull/1428 to get merged.
Documentation for resources is built during build time. Docs for Index is build in posttrans phase as we need foreman plugins to be present.
For apipie:cache to run we need  to start he rails app and thus the DB to by ready. Is there any better way?