Skip to content

Commit 1ca24e9

Browse files
Info command (#376)
Adds info command to redisplay the info from the deploy notes for an app. Also add a new command set for "apps" since "repos" is unintuitive.
1 parent 67275ea commit 1ca24e9

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

cmd/plural/deploy.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (p *Plural) doBuild(installation *api.Installation, force bool) error {
121121
fmt.Printf("Building workspace for %s\n", repoName)
122122

123123
if !wkspace.Configured(repoName) {
124-
return fmt.Errorf("You have not locally configured %s but have it registered as an installation in our api, either delete it with `plural repos uninstall %s` or install it locally via a bundle in `plural bundle list %s`", repoName, repoName, repoName)
124+
return fmt.Errorf("You have not locally configured %s but have it registered as an installation in our api, either delete it with `plural apps uninstall %s` or install it locally via a bundle in `plural bundle list %s`", repoName, repoName, repoName)
125125
}
126126

127127
workspace, err := wkspace.New(p.Client, installation)
@@ -184,6 +184,20 @@ func (p *Plural) doValidate(installation *api.Installation) error {
184184
return workspace.Validate()
185185
}
186186

187+
func (p *Plural) info(c *cli.Context) error {
188+
p.InitPluralClient()
189+
repo := c.Args().Get(0)
190+
installation, err := p.GetInstallation(repo)
191+
if err != nil {
192+
return api.GetErrorResponse(err, "GetInstallation")
193+
}
194+
if installation == nil {
195+
return fmt.Errorf("You have not installed %s", repo)
196+
}
197+
198+
return scaffold.Notes(installation)
199+
}
200+
187201
func (p *Plural) deploy(c *cli.Context) error {
188202
p.InitPluralClient()
189203
verbose := c.Bool("verbose")

cmd/plural/plural.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ func (p *Plural) getCommands() []cli.Command {
9393
},
9494
Action: tracked(rooted(latestVersion(owned(upstreamSynced(p.build)))), "cli.build"),
9595
},
96+
{
97+
Name: "info",
98+
Usage: "Get information for your installation of APP",
99+
ArgsUsage: "APP",
100+
Action: latestVersion(owned(rooted(p.info))),
101+
},
96102
{
97103
Name: "deploy",
98104
Aliases: []string{"d"},
@@ -317,6 +323,12 @@ func (p *Plural) getCommands() []cli.Command {
317323
Subcommands: p.reposCommands(),
318324
Category: "API",
319325
},
326+
{
327+
Name: "apps",
328+
Usage: "view and manage plural repositories",
329+
Subcommands: p.reposCommands(),
330+
Category: "API",
331+
},
320332
{
321333
Name: "test",
322334
Usage: "validate a values templace",

0 commit comments

Comments
 (0)