Run docs and man generation in CI

Also cleanup the scripts a bit to be more consistent, and fail on errors.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 343d836a95
Component: cli
This commit is contained in:
Daniel Nephin
2017-06-14 13:42:58 -07:00
parent 7b49eaf104
commit 1bcf02da4f
5 changed files with 69 additions and 19 deletions

View File

@ -1,25 +1,14 @@
#!/usr/bin/env bash
#
# Generate man pages for docker/docker
#
set -eu
# Generate man pages for docker/cli
set -eu -o pipefail
mkdir -p ./man/man1
MD2MAN_REPO=github.com/cpuguy83/go-md2man
MD2MAN_COMMIT=$(grep -F "$MD2MAN_REPO" vendor.conf | cut -d' ' -f2)
(
go get -d "$MD2MAN_REPO"
cd "$GOPATH"/src/"$MD2MAN_REPO"
git checkout "$MD2MAN_COMMIT" &> /dev/null
go install "$MD2MAN_REPO"
)
go install ./vendor/github.com/cpuguy83/go-md2man
# Generate man pages from cobra commands
go build -o /tmp/gen-manpages github.com/docker/cli/man
/tmp/gen-manpages --root . --target ./man/man1
/tmp/gen-manpages --root $(pwd) --target $(pwd)/man/man1
# Generate legacy pages from markdown
./man/md2man-all.sh -q

View File

@ -1,5 +1,8 @@
#!/bin/sh
#!/usr/bin/env bash
# Generate yaml for docker/cli reference docs
set -eu -o pipefail
mkdir -p docs/yaml/gen
go build -o build/yaml-docs-generator github.com/docker/cli/docs/yaml
mkdir docs/yaml/gen
build/yaml-docs-generator --root $(pwd) --target $(pwd)/docs/yaml/gen