From 01a12a36848a30fdba0d4c9c3c7d46784dbd3434 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Tue, 2 Oct 2018 09:44:26 +0200 Subject: [PATCH] Add docs for plan command. Closes #235 --- docs/commands.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/commands.md b/docs/commands.md index 725a89313..09ce9ce33 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -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. @@ -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. @@ -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. \ No newline at end of file +The `version` command displays build information about the running binary, including the release version.