migrate docs-build.sh from releng repo