Skip to content

Commit

Permalink
Merge pull request #6 from ehl-jf/feature/WKS-969
Browse files Browse the repository at this point in the history
Group worker commands into a namespace
  • Loading branch information
RemiBou authored May 21, 2024
2 parents e9c7416 + 0bbd0d7 commit 1015730
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
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())
}

0 comments on commit 1015730

Please sign in to comment.