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

Build metrics #2104

Merged
merged 4 commits into from
Nov 23, 2021
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
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"}
gtardif marked this conversation as resolved.
Show resolved Hide resolved
)

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