Skip to content

Commit

Permalink
Merge pull request #240 from jrasell/gh_235
Browse files Browse the repository at this point in the history
Add docs for plan command.
  • Loading branch information
jrasell committed Oct 2, 2018
2 parents c1a3df0 + 01a12a3 commit c1733af
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Levant supports a number of command line arguments which provide control over th

* **-address** (string: "http://localhost:4646") The HTTP API endpoint for Nomad where all calls will be made.

* **-allow-stale** (bool: false) Allow stale consistency mode for requests into nomad.

* **-canary-auto-promote** (int: 0) The time period in seconds that Levant should wait for before attempting to promote a canary deployment.

* **-consul-address** (string: "localhost:8500") The Consul host and port to use when making Consul KeyValue lookups for template rendering.
Expand Down Expand Up @@ -52,6 +54,34 @@ Full example:
levant dispatch -log-level=debug -address=nomad.devoops -meta key=value dispatch_job payload_item
```

### Plan: `plan`

`plan` allows you to perform a Nomad plan of a rendered template job. This is useful for seeing the expected changes before larger deploys.

* **-address** (string: "http://localhost:4646") The HTTP API endpoint for Nomad where all calls will be made.

* **-allow-stale** (bool: false) Allow stale consistency mode for requests into nomad.

* **-consul-address** (string: "localhost:8500") The Consul host and port to use when making Consul KeyValue lookups for template rendering.

* **-force-count** (bool: false) Use the taskgroup count from the Nomad job file instead of the count that is obtained from the running job count.

* **-ignore-no-changes** (bool: false) By default if no changes are detected when running a deployment Levant will exit with a status 1 to indicate a deployment didn't happen. This behaviour can be changed using this flag so that Levant will exit cleanly ensuring CD pipelines don't fail when no changes are detected

* **-log-level** (string: "INFO") The level at which Levant will log to. Valid values are DEBUG, INFO, WARNING, ERROR and FATAL.

* **-log-format** (string: "HUMAN") Specify the format of Levant's logs. Valid values are HUMAN or JSON

* **-var-file** (string: "") The variables file to render the template with. This flag can be specified multiple times to supply multiple variables files.

The `plan` command also supports passing variables individually on the command line. Multiple commands can be passed in the format of `-var 'key=value'`. Variables passed via the command line take precedence over the same variable declared within a passed variable file.

Full example:

```
levant plan -log-level=debug -address=nomad.devoops -var-file=var.yaml -var 'var=test' example.nomad
```

### Command: `render`

`render` allows rendering of a Nomad job template without deploying, useful when testing or debugging. Levant also supports autoloading files by which Levant will look in the current working directory for a `levant.[yaml,yml,tf]` file and a single `*.nomad` file to use for the command actions.
Expand Down Expand Up @@ -116,4 +146,4 @@ levant scale-out -percent 30 -task-group cache example

### Command: `version`

The `version` command displays build information about the running binary, including the release version.
The `version` command displays build information about the running binary, including the release version.

0 comments on commit c1733af

Please sign in to comment.