Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2104 from crazy-max/build-metrics
Browse files Browse the repository at this point in the history
Build metrics
  • Loading branch information
mat007 authored Nov 23, 2021
2 parents e51e2c7 + 535fb93 commit cde09e2
Show file tree
Hide file tree
Showing 15 changed files with 469 additions and 84 deletions.
160 changes: 81 additions & 79 deletions cli/metrics/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,131 +19,133 @@ package metrics
var commandFlags = []string{
//added to catch scan details
"--version", "--login",
// added for build
"--builder", "--platforms",
}

// Generated with generatecommands/main.go
var managementCommands = []string{
"help",
"ecs",
"scan",
"app",
"builder",
"imagetools",
"buildx",
"checkpoint",
"compose",
"config",
"container",
"context",
"create",
"ecs",
"image",
"imagetools",
"key",
"login",
"logout",
"manifest",
"network",
"node",
"plugin",
"scan",
"secret",
"service",
"signer",
"stack",
"swarm",
"system",
"key",
"signer",
"trust",
"volume",
"login",
"logout",
"compose",
}

var commands = []string{
"aci",
"add",
"annotate",
"attach",
"azure",
"b",
"bake",
"build",
"bundle",
"ca",
"commit",
"completion",
"init",
"inspect",
"install",
"deploy",
"list",
"ls",
"config",
"connect",
"convert",
"cp",
"merge",
"pull",
"push",
"render",
"split",
"status",
"uninstall",
"upgrade",
"validate",
"version",
"build",
"prune",
"create",
"bake",
"f",
"b",
"du",
"rm",
"stop",
"use",
"remove",
"attach",
"commit",
"cp",
"demote",
"deploy",
"df",
"diff",
"disable",
"disconnect",
"down",
"du",
"ecs",
"enable",
"events",
"exec",
"export",
"f",
"generate",
"history",
"images",
"import",
"info",
"init",
"inspect",
"install",
"join",
"join-token",
"kill",
"leave",
"list",
"load",
"login",
"logout",
"logs",
"ps",
"ls",
"merge",
"pause",
"port",
"promote",
"prune",
"ps",
"pull",
"push",
"remove",
"rename",
"render",
"restart",
"revoke",
"rm",
"rmi",
"rollback",
"run",
"save",
"scale",
"search",
"services",
"set",
"show",
"sign",
"split",
"start",
"stats",
"status",
"stop",
"tag",
"top",
"uninstall",
"unlock",
"unlock-key",
"unpause",
"up",
"update",
"upgrade",
"use",
"validate",
"version",
"wait",
"aci",
"ecs",
"show",
"history",
"import",
"load",
"images",
"rmi",
"save",
"tag",
"annotate",
"connect",
"disconnect",
"demote",
"promote",
"disable",
"enable",
"set",
"rollback",
"scale",
"up",
"down",
"services",
"ca",
"join",
"join-token",
"leave",
"unlock",
"unlock-key",
"df",
"events",
"info",
"generate",
"add",
"revoke",
"sign",
"login",
"azure",
"logout",
"search",
"convert",
}
16 changes: 12 additions & 4 deletions cli/metrics/generatecommands/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,26 @@ package main
import (
"fmt"
"os/exec"
"sort"
"strings"

"github.com/docker/compose/v2/pkg/utils"
)

var managementCommands = []string{"ecs", "scan"}

var commands = []string{}
var (
managementCommands = []string{"ecs", "scan"}
commands = []string{"bundle", "completion", "install", "merge", "render", "split", "status", "uninstall", "validate"}
)

func main() {
fmt.Println("Walking through docker help to list commands...")
getCommands()
getCommands("buildx")
getCommands("compose")

sort.Strings(managementCommands)
sort.Strings(commands)

fmt.Printf(`
var managementCommands = []string{
"help",
Expand Down Expand Up @@ -71,7 +77,9 @@ func getCommands(execCommands ...string) {
section = commandsSection
if len(execCommands) > 0 {
command := execCommands[len(execCommands)-1]
managementCommands = append(managementCommands, command)
if !utils.StringContains(managementCommands, command) {
managementCommands = append(managementCommands, command)
}
}
continue
}
Expand Down
Loading

0 comments on commit cde09e2

Please sign in to comment.