Skip to content

Commit

Permalink
fix(CLI): Fix help text & restructure verison command (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander authored Apr 6, 2017
1 parent 6abaa5c commit aa06a96
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 53 deletions.
92 changes: 52 additions & 40 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Table of Contents
* [**hal**](#hal)
* [**hal versions**](#hal-versions)
* [**hal versions bom**](#hal-versions-bom)
* [**hal versions latest**](#hal-versions-latest)
* [**hal admin**](#hal-admin)
* [**hal admin publish**](#hal-admin-publish)
* [**hal admin publish bom**](#hal-admin-publish-bom)
Expand Down Expand Up @@ -134,6 +131,10 @@
* [**hal config version edit**](#hal-config-version-edit)
* [**hal config deploy**](#hal-config-deploy)
* [**hal config deploy edit**](#hal-config-deploy-edit)
* [**hal version**](#hal-version)
* [**hal version bom**](#hal-version-bom)
* [**hal version list**](#hal-version-list)
* [**hal version latest**](#hal-version-latest)
* [**hal deploy**](#hal-deploy)
* [**hal deploy rollback**](#hal-deploy-rollback)
* [**hal deploy actuate**](#hal-deploy-actuate)
Expand Down Expand Up @@ -195,43 +196,7 @@ hal [parameters] [subcommands]
* `admin`: This is meant for users building and publishing their own Spinnaker images and config.
* `config`: Configure, validate, and view your halconfig.
* `deploy`: Manage the deployment of Spinnaker. This includes where it's deployed, what the infrastructure footprint looks like, what the currently running deployment looks like, etc...
* `versions`: List the available Spinnaker versions and their changelogs.

---
## hal versions

All Spinnaker releases that have been fully validated are listed here. You can pick one of these releases to deploy using the `hal config version edit` command. There are unlisted, non-supported releases as well, but we advise against running them. For more information, contact the developers at http://join.spinnaker.io.

#### Usage
```
hal versions [subcommands]
```
#### Subcommands
* `bom`: Get the Bill of Materials (BOM) for the specified version.
* `latest`: Get the latest released, validated version number of Spinnaker.

---
## hal versions bom

The Bill of Materials (BOM) is the manifest Halyard and Spinnaker use to agree on what subcomponent versions comprise a top-level release of Spinnaker. This command can be used with a main parameter (VERSION) to get the BOM for a given version of Spinnaker, or without a parameter to get the BOM for whatever versin of Spinnaker are currently configuring.

#### Usage
```
hal versions bom VERSION [parameters]
```
#### Parameters
`VERSION`: The version whose Bill of Materials (BOM) to lookup.
* `--no-validate`: (*Default*: `false`) Skip validation.

---
## hal versions latest

Get the latest released, validated version number of Spinnaker.

#### Usage
```
hal versions latest
```
* `version`: Get information about the available Spinnaker versions.

---
## hal admin
Expand Down Expand Up @@ -2249,6 +2214,53 @@ LocalhostDebian: Download and run the Spinnaker debians on the machine running t
* `--vault-address`: The address of a running Vault datastore. See https://www.vaultproject.io/.This is only required when Spinnaker is being deployed in non-Kubernetes clustered configuration.
* `--vault-enabled`: Whether or not to use Vault as a secret storage mechanism to deploy Spinnaker.

---
## hal version

Get information about the available Spinnaker versions.

#### Usage
```
hal version [subcommands]
```
#### Subcommands
* `bom`: Get the Bill of Materials (BOM) for the specified version.
* `latest`: Get the latest released, validated version number of Spinnaker.
* `list`: List the available Spinnaker versions and their changelogs.

---
## hal version bom

The Bill of Materials (BOM) is the manifest Halyard and Spinnaker use to agree on what subcomponent versions comprise a top-level release of Spinnaker. This command can be used with a main parameter (VERSION) to get the BOM for a given version of Spinnaker, or without a parameter to get the BOM for whatever version of Spinnaker you are currently configuring.

#### Usage
```
hal version bom VERSION [parameters]
```
#### Parameters
`VERSION`: The version whose Bill of Materials (BOM) to lookup.
* `--no-validate`: (*Default*: `false`) Skip validation.

---
## hal version list

All Spinnaker releases that have been fully validated are listed here. You can pick one of these releases to deploy using the `hal config version edit` command. There are unlisted, non-supported releases as well, but we advise against running them. For more information, contact the developers at http://join.spinnaker.io.

#### Usage
```
hal version list
```

---
## hal version latest

Get the latest released, validated version number of Spinnaker.

#### Usage
```
hal version latest
```

---
## hal deploy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ConfigCommand extends NestableCommand {
registerSubcommand(new PersistentStorageCommand());
registerSubcommand(new ProviderCommand());
registerSubcommand(new SecurityCommand());
registerSubcommand(new VersionCommand());
registerSubcommand(new VersionConfigCommand());
registerSubcommand(new WebhookCommand());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public HalCommand() {
registerSubcommand(new AdminCommand());
registerSubcommand(new ConfigCommand());
registerSubcommand(new DeployCommand());
registerSubcommand(new VersionsCommand());
registerSubcommand(new VersionCommand());
}

private String getVersion() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2017 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.spinnaker.halyard.cli.command.v1;

import com.beust.jcommander.Parameters;
import com.netflix.spinnaker.halyard.cli.command.v1.versions.BomVersionCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.versions.LatestVersionCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.versions.ListVersionCommand;
import lombok.AccessLevel;
import lombok.Getter;

@Parameters()
public class VersionCommand extends NestableCommand {
@Getter(AccessLevel.PUBLIC)
private String commandName = "version";

@Getter(AccessLevel.PUBLIC)
private String shortDescription = "Get information about the available Spinnaker versions.";

@Getter(AccessLevel.PUBLIC)
private String longDescription = shortDescription;

public VersionCommand() {
registerSubcommand(new LatestVersionCommand());
registerSubcommand(new BomVersionCommand());
registerSubcommand(new ListVersionCommand());
}

@Override
protected void executeThis() {
showHelp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import lombok.AccessLevel;
import lombok.Getter;

public class VersionCommand extends AbstractConfigCommand {
public class VersionConfigCommand extends AbstractConfigCommand {
@Getter(AccessLevel.PUBLIC)
private String commandName = "version";

@Getter(AccessLevel.PUBLIC)
private String description = "Configure & view the current deployment of Spinnaker's version.";

public VersionCommand() {
public VersionConfigCommand() {
registerSubcommand(new EditVersionCommand());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class BomVersionCommand extends AbstractConfigCommand {
"to agree on what subcomponent versions comprise a top-level release of",
"Spinnaker. This command can be used with a main parameter (VERSION) to",
"get the BOM for a given version of Spinnaker, or without a parameter to",
"get the BOM for whatever versin of Spinnaker are currently configuring."
"get the BOM for whatever version of Spinnaker you are currently configuring."
);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package com.netflix.spinnaker.halyard.cli.command.v1;
package com.netflix.spinnaker.halyard.cli.command.v1.versions;

import com.beust.jcommander.Parameters;
import com.netflix.spinnaker.halyard.cli.command.v1.NestableCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.versions.BomVersionCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.versions.LatestVersionCommand;
import com.netflix.spinnaker.halyard.cli.services.v1.Daemon;
Expand All @@ -27,9 +29,9 @@
import lombok.Getter;

@Parameters()
public class VersionsCommand extends NestableCommand {
public class ListVersionCommand extends NestableCommand {
@Getter(AccessLevel.PUBLIC)
private String commandName = "versions";
private String commandName = "list";

@Getter(AccessLevel.PUBLIC)
private String shortDescription = "List the available Spinnaker versions and their changelogs.";
Expand All @@ -42,11 +44,6 @@ public class VersionsCommand extends NestableCommand {
"running them. For more information, contact the developers at http://join.spinnaker.io."
);

public VersionsCommand() {
registerSubcommand(new LatestVersionCommand());
registerSubcommand(new BomVersionCommand());
}

@Override
protected void executeThis() {
Versions versions = new OperationHandler<Versions>()
Expand Down

0 comments on commit aa06a96

Please sign in to comment.