Skip to content

Commit

Permalink
Remove deprecated components (vmware-tanzu#643)
Browse files Browse the repository at this point in the history
* Remove deprecated components

* Update the markdown files

* Remove server methods from e2e

* Remove unused builder publish command
  • Loading branch information
mpanchajanya authored Jan 19, 2024
1 parent 7eb5dff commit 8845d20
Show file tree
Hide file tree
Showing 39 changed files with 44 additions and 1,548 deletions.
2 changes: 1 addition & 1 deletion apis/cli/v1alpha1/cliplugin_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Artifact struct {
URI string `json:"uri,omitempty"`
// SHA256 hash of the plugin binary.
Digest string `json:"digest,omitempty"`
// Type of the binary artifact. Valid values are S3, GCP, OCIImage.
// Type of the binary artifact. Valid values are S3, OCIImage.
Type string `json:"type"`
// OS of the plugin binary in `GOOS` format.
OS string `json:"os"`
Expand Down
2 changes: 1 addition & 1 deletion apis/config/crd/bases/cli.tanzu.vmware.com_cliplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
type: string
type:
description: Type of the binary artifact. Valid values are
S3, GCP, OCIImage.
S3, OCIImage.
type: string
uri:
description: AssetURI is a URI of the plugin binary. This
Expand Down
19 changes: 0 additions & 19 deletions cmd/plugin/builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,6 @@ tanzu builder init <repo-name> --dry-run

`tanzu builder cli add-plugin <plugin-name>` adds a new plugin to your repository. The plugins command will live in the `./cmd/plugin/<plugin-name>` directory.

### Compile

`tanzu builder cli compile` will compile a repository and create the artifacts to be used with tanzu cli.

The artifact output directory structure will be created to match the expected layout. This will include some plugin
metadata used in the publishing and installation of plugins in a `manifest.yaml` file and a `plugin.yaml` file for
each included plugin.

Plugins will find that their `make build` command will suffice for most compile cases, but there are many flags at your disposal as well:

```txt
--artifacts string path to output artifacts (default "artifacts")
--ldflags string ldflags to set on build
--match string match a plugin name to build, supports globbing (default "*")
--path string path of the plugins directory (default "./cmd/cli/plugin")
--target string only compile for a specific target, use 'local' to compile for host os (default "all")
--version string version of the root cli (required)
```

### Build-plugins

`tanzu builder plugin build` can be used to build the plugins and create artifacts that can be used with tanzu cli.
Expand Down
38 changes: 0 additions & 38 deletions cmd/plugin/builder/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package main

import (
"fmt"

"github.com/spf13/cobra"

"github.com/vmware-tanzu/tanzu-plugin-runtime/component"
Expand All @@ -18,53 +16,17 @@ var (
description string
)

// defaultArtifactsDirectory is the root of the default directory where a plugin is built.
// This can be overridden by the `--artifacts` flag of the `builder cli compile` command.
const defaultArtifactsDirectory = "artifacts"

var compileArgs = &command.PluginCompileArgs{
Match: "*",
TargetArch: []string{"all"},
SourcePath: "./cmd/plugin",
ArtifactsDir: defaultArtifactsDirectory,
}

// NewCLICmd creates the CLI builder commands.
func NewCLICmd() *cobra.Command {
cmd := &cobra.Command{
Use: "cli",
Short: "Build CLIs",
}

cmd.AddCommand(newCompileCmd())
cmd.AddCommand(newAddPluginCmd())
return cmd
}

// newCompileCmd compiles CLI plugins.
func newCompileCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "compile",
Short: "Compile a repository",
RunE: func(cmd *cobra.Command, args []string) error {
return command.Compile(compileArgs)
},
}

cmd.Flags().StringVar(&compileArgs.Version, "version", "", "Version of the core tanzu cli")
cmd.Flags().StringVar(&compileArgs.LDFlags, "ldflags", "", "ldflags to set on build")
cmd.Flags().StringVar(&compileArgs.Tags, "tags", "", "Tags to set on build")
cmd.Flags().StringVar(&compileArgs.Match, "match", compileArgs.Match, "Match a plugin name to build, supports globbing")
cmd.Flags().StringArrayVar(&compileArgs.TargetArch, "target", compileArgs.TargetArch, "Only compile for specific target(s), use 'local' to compile for host os")
cmd.Flags().StringVar(&compileArgs.SourcePath, "path", compileArgs.SourcePath, "Path of the plugins source directory")
cmd.Flags().StringVar(&compileArgs.ArtifactsDir, "artifacts", compileArgs.ArtifactsDir, "Path to output artifacts")
cmd.Flags().StringVar(&compileArgs.GoPrivate, "goprivate", "", "Comma-separated list of glob patterns of module path prefixes to set as GOPRIVATE on build")

cmd.Deprecated = fmt.Sprintf("use %q instead.", "tanzu builder plugin build")

return cmd
}

// newAddPluginCmd adds a cli plugin to the repository.
func newAddPluginCmd() *cobra.Command {
cmd := &cobra.Command{
Expand Down
61 changes: 0 additions & 61 deletions cmd/plugin/builder/command/publish.go

This file was deleted.

220 changes: 0 additions & 220 deletions cmd/plugin/builder/command/publish/helper.go

This file was deleted.

Loading

0 comments on commit 8845d20

Please sign in to comment.