Skip to content

Commit

Permalink
Generate YAML doc
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Aug 25, 2021
1 parent a8a3b17 commit b8a6028
Show file tree
Hide file tree
Showing 130 changed files with 10,891 additions and 13,505 deletions.
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ignore: |
/vendor
/docs/reference
extends: default

Expand Down
42 changes: 42 additions & 0 deletions docs/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package main

import (
"log"
"os"
"path/filepath"

"github.com/docker/buildx/commands"
clidocstool "github.com/docker/cli-docs-tool"
"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"
)

const sourcePath = "docs/reference/"

func main() {
log.SetFlags(0)

dockerCLI, err := command.NewDockerCli()
if err != nil {
log.Printf("ERROR: %+v", err)
}

cmd := &cobra.Command{
Use: "docker [OPTIONS] COMMAND [ARG...]",
Short: "The base command for the Docker CLI.",
DisableAutoGenTag: true,
}

cmd.AddCommand(commands.NewRootCmd("buildx", true, dockerCLI))
clidocstool.DisableFlagsInUseLine(cmd)

cwd, _ := os.Getwd()
source := filepath.Join(cwd, sourcePath)

if err = os.MkdirAll(source, 0755); err != nil {
log.Printf("ERROR: %+v", err)
}
if err = clidocstool.GenTree(cmd, source); err != nil {
log.Printf("ERROR: %+v", err)
}
}
46 changes: 46 additions & 0 deletions docs/reference/docker_buildx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
command: docker buildx
short: Build with BuildKit
long: Build with BuildKit
pname: docker
plink: docker.yaml
cname:
- docker buildx bake
- docker buildx build
- docker buildx create
- docker buildx du
- docker buildx imagetools
- docker buildx inspect
- docker buildx ls
- docker buildx prune
- docker buildx rm
- docker buildx stop
- docker buildx use
- docker buildx version
clink:
- docker_buildx_bake.yaml
- docker_buildx_build.yaml
- docker_buildx_create.yaml
- docker_buildx_du.yaml
- docker_buildx_imagetools.yaml
- docker_buildx_inspect.yaml
- docker_buildx_ls.yaml
- docker_buildx_prune.yaml
- docker_buildx_rm.yaml
- docker_buildx_stop.yaml
- docker_buildx_use.yaml
- docker_buildx_version.yaml
options:
- option: builder
value_type: string
description: Override the configured builder instance
deprecated: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false

Loading

0 comments on commit b8a6028

Please sign in to comment.