Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ jobs:
apk add -U bash curl
curl -s https://codecov.io/bash | bash
- run:
name: "Validate Vendor and Code Generation"
name: "Validate Vendor, Docs, and Code Generation"
command: |
if [ "$CIRCLE_NODE_INDEX" != "3" ]; then exit; fi
dockerfile=dockerfiles/Dockerfile.dev
echo "COPY . ." >> $dockerfile
rm -f .dockerignore # include .git
docker build -f $dockerfile --tag cli-builder .
docker run cli-builder make -B vendor compose-jsonschema
docker run cli-builder make -B vendor compose-jsonschema manpages yamldocs

- store_artifacts:
path: /work/build
7 changes: 7 additions & 0 deletions man/import.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +build never

package main

// Not used, but required for generating other man pages.
// Import it here so that the package is included by vndr.
import _ "github.com/cpuguy83/go-md2man"
19 changes: 4 additions & 15 deletions scripts/docs/generate-man.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions scripts/docs/generate-yaml.sh
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions vendor/github.com/cpuguy83/go-md2man/md2man.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.