moby/hooks/post_build
French Ben 43e3b8d2cc docs: added support for CLI yaml file generation
Signed-off-by: French Ben <frenchben@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 5443f0152f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-03-28 17:41:46 -07:00

19 lines
462 B
Bash
Executable file

#!/bin/bash
if [ -n "${BUILD_DOCS}" ]; then
set -e
DOCS_IMAGE=${DOCS_IMAGE:-${IMAGE_NAME}-docs}
docker run \
--entrypoint '' \
--privileged \
-e DOCKER_GITCOMMIT=$(git rev-parse --short HEAD) \
-v $(pwd)/docs/yaml/docs:/docs \
"${IMAGE_NAME}" \
sh -c 'hack/make.sh yaml-docs-generator && bundles/latest/yaml-docs-generator/yaml-docs-generator --target /docs'
(
cd docs/yaml
docker build -t ${DOCS_IMAGE} .
docker push ${DOCS_IMAGE}
)
fi