...

Text file src/github.com/docker/cli/scripts/docs/generate-yaml.sh

Documentation: github.com/docker/cli/scripts/docs

     1#!/usr/bin/env bash
     2
     3set -eu
     4
     5: "${CLI_DOCS_TOOL_VERSION=v0.7.0}"
     6
     7export GO111MODULE=auto
     8
     9function clean {
    10  rm -rf "$buildir"
    11}
    12
    13buildir=$(mktemp -d -t docker-cli-docsgen.XXXXXXXXXX)
    14trap clean EXIT
    15
    16(
    17  set -x
    18  cp -r . "$buildir/"
    19  cd "$buildir"
    20  # init dummy go.mod
    21  ./scripts/vendor init
    22  # install cli-docs-tool and copy docs/tools.go in root folder
    23  # to be able to fetch the required depedencies
    24  go mod edit -modfile=vendor.mod -require=github.com/docker/cli-docs-tool@${CLI_DOCS_TOOL_VERSION}
    25  cp docs/generate/tools.go .
    26  # update vendor
    27  ./scripts/vendor update
    28  # build docsgen
    29  go build -mod=vendor -modfile=vendor.mod -tags docsgen -o /tmp/docsgen ./docs/generate/generate.go
    30)
    31
    32mkdir -p docs/yaml
    33set -x
    34/tmp/docsgen --formats yaml --source "$(pwd)/docs/reference/commandline" --target "$(pwd)/docs/yaml"

View as plain text