Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group worker commands into a namespace #6

Merged
merged 1 commit into from
May 21, 2024
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
40 changes: 23 additions & 17 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,30 @@ import (
"github.com/jfrog/jfrog-cli-platform-services/commands"
)

func GetWorkerApp() components.App {
app := components.App{}
app.Name = "worker"
app.Description = "Tools for managing workers"
app.Version = "v1.0.0"
app.Commands = getWorkerCommands()
return app
const category = "Platform Services"

func GetPlatformServicesApp() components.App {
return components.CreateEmbeddedApp(
category,
nil,
getWorkerNamespace(),
)
}

func getWorkerCommands() []components.Command {
return []components.Command{
commands.GetInitCommand(),
commands.GetDryRunCommand(),
commands.GetDeployCommand(),
commands.GetExecuteCommand(),
commands.GetRemoveCommand(),
commands.GetListCommand(),
commands.GetAddSecretCommand(),
commands.GetListEventsCommand(),
func getWorkerNamespace() components.Namespace {
return components.Namespace{
Name: "worker",
Description: "Tools for managing workers",
Category: category,
Commands: []components.Command{
commands.GetInitCommand(),
commands.GetDryRunCommand(),
commands.GetDeployCommand(),
commands.GetExecuteCommand(),
commands.GetRemoveCommand(),
commands.GetListCommand(),
commands.GetAddSecretCommand(),
commands.GetListEventsCommand(),
},
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module github.com/jfrog/jfrog-cli-platform-services

require (
github.com/google/uuid v1.6.0
github.com/jfrog/jfrog-cli-core/v2 v2.51.0
github.com/jfrog/jfrog-client-go v1.40.1
github.com/stretchr/testify v1.9.0
Expand Down Expand Up @@ -31,7 +32,6 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
Expand Down
2 changes: 1 addition & 1 deletion itests/infra/itest_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Test struct {
t *testing.T
}

var runPlugin = plugins.RunCliWithPlugin(cli.GetWorkerApp())
var runPlugin = plugins.RunCliWithPlugin(cli.GetPlatformServicesApp())

func RunITests(tests []TestDefinition, t *testing.T) {
if testing.Short() {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import (
)

func main() {
plugins.PluginMain(cli.GetWorkerApp())
plugins.PluginMain(cli.GetPlatformServicesApp())
}
Loading