Skip to content

Commit

Permalink
refactor: consistently use verb before noun in CLI
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
The following CLI commands have now been renamed, and any scripts
using them need to be updated accordingly:
`config delete` -> `delete config`
`config get` -> `get config`
`config set` -> `set config`
`environment configure` -> `init environment`
`environment destroy` -> `delete environment`
`status` -> `get status`
  • Loading branch information
edvald committed Jun 18, 2018
1 parent df8a2c4 commit e88e55e
Show file tree
Hide file tree
Showing 18 changed files with 434 additions and 483 deletions.
131 changes: 58 additions & 73 deletions docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,65 +74,20 @@ Note: Currently only supports HTTP/HTTPS endpoints.
| -------- | -------- | ----------- |
| `serviceAndPath` | Yes | The name of the service(s) to call followed by the endpoint path (e.g. my-container/somepath).

### garden config get
### garden delete config

Get a configuration variable from the environment..
Delete a configuration variable from the environment..

Returns with an error if the provided key could not be found in the configuration.

Examples:

garden get somekey
garden get some.nested.key
garden delete config somekey
garden del config some.nested.key

##### Usage

garden config get <key>

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `key` | Yes | The key of the configuration variable. Separate with dots to get a nested key (e.g. key.nested).

### garden config set

Set a configuration variable in the environment..

These configuration values can be referenced in module templates, for example as environment variables.

_Note: The value is always stored as a string._

Examples:

garden set somekey myvalue
garden set some.nested.key myvalue

##### Usage

garden config set <key> <value>

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `key` | Yes | The key of the configuration variable. Separate with dots to get a nested key (e.g. key.nested).
| `value` | Yes | The value of the configuration variable.

### garden config delete

Delete a configuration variable from the Garden environment..

Returns with an error if the provided key could not be found in the configuration.

Examples:

garden delete somekey
garden delete some.nested.key

##### Usage

garden config delete <key>
garden delete config <key>

##### Arguments

Expand Down Expand Up @@ -196,43 +151,58 @@ Starts the garden development console..

garden dev

### garden environment configure
### garden get config

Configures your environment..
Get a configuration variable from the environment..

Generally, environments are configured automatically as part of other commands that you run.
However, this command is useful if you want to make sure the environment is ready before running
another command, or if you need to force a reconfiguration using the --force flag.
Returns with an error if the provided key could not be found in the configuration.

Examples:

garden env configure
garden env configure --force
garden get config somekey
garden get config some.nested.key

##### Usage

garden environment configure [options]
garden get config <key>

##### Options
##### Arguments

| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--force` | | boolean | Force reconfiguration of environment, ignoring the environment status check.
| Argument | Required | Description |
| -------- | -------- | ----------- |
| `key` | Yes | The key of the configuration variable. Separate with dots to get a nested key (e.g. key.nested).

### garden environment destroy
### garden get status

Destroy an environment..
Outputs the status of your environment..

Generally not as dramatic as it sounds :) This will trigger providers clear up any deployments in a
Garden environment and reset it. When you then run &#x60;garden env configure&#x60; or any deployment command,
the environment will be reconfigured.

This can be useful if you find the environment to be in an inconsistent state, or need/want to free up
resources.
##### Usage

garden get status

### garden init environment

Initializes your environment..

Generally, environments are initialized automatically as part of other commands that you run.
However, this command is useful if you want to make sure the environment is ready before running
another command, or if you need to force a re-initialization using the --force flag.

Examples:

garden init env
garden init env --force

##### Usage

garden environment destroy
garden init environment [options]

##### Options

| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--force` | | boolean | Force initalization of environment, ignoring the environment status check.

### garden login

Expand Down Expand Up @@ -413,14 +383,29 @@ Scans your project and outputs an overview of all modules..

garden scan

### garden status
### garden set config

Outputs the status of your environment..
Set a configuration variable in the environment..

These configuration values can be referenced in module templates, for example as environment variables.

_Note: The value is always stored as a string._

Examples:

garden set config somekey myvalue
garden set config some.nested.key myvalue

##### Usage

garden status
garden set config <key> <value>

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `key` | Yes | The key of the configuration variable. Separate with dots to get a nested key (e.g. key.nested).
| `value` | Yes | The value of the configuration variable.

### garden test

Expand Down
14 changes: 8 additions & 6 deletions src/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@
import { Command } from "./base"
import { BuildCommand } from "./build"
import { CallCommand } from "./call"
import { ConfigCommand } from "./config/config"
import { InitCommand } from "./init"
import { DeleteCommand } from "./delete"
import { DeployCommand } from "./deploy"
import { DevCommand } from "./dev"
import { EnvironmentCommand } from "./environment/environment"
import { GetCommand } from "./get"
import { LoginCommand } from "./login"
import { LogoutCommand } from "./logout"
import { LogsCommand } from "./logs"
import { PushCommand } from "./push"
import { RunCommand } from "./run/run"
import { ScanCommand } from "./scan"
import { StatusCommand } from "./status"
import { SetCommand } from "./set"
import { TestCommand } from "./test"
import { ValidateCommand } from "./validate"

export const coreCommands: Command[] = [
new BuildCommand(),
new CallCommand(),
new ConfigCommand(),
new DeleteCommand(),
new DeployCommand(),
new DevCommand(),
new EnvironmentCommand(),
new GetCommand(),
new InitCommand(),
new LoginCommand(),
new LogoutCommand(),
new LogsCommand(),
new PushCommand(),
new RunCommand(),
new ScanCommand(),
new StatusCommand(),
new SetCommand(),
new TestCommand(),
new ValidateCommand(),
]
26 changes: 0 additions & 26 deletions src/commands/config/config.ts

This file was deleted.

59 changes: 0 additions & 59 deletions src/commands/config/delete.ts

This file was deleted.

57 changes: 0 additions & 57 deletions src/commands/config/get.ts

This file was deleted.

Loading

0 comments on commit e88e55e

Please sign in to comment.