From a883bbfb42d955ebe58974cce458c70bec3075c2 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Mon, 3 Oct 2016 15:50:35 -0400 Subject: [PATCH] Fix HCL on interpreted.html --- .../source/docs/jobspec/interpreted.html.md | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/website/source/docs/jobspec/interpreted.html.md b/website/source/docs/jobspec/interpreted.html.md index cd22a8367..81d79f7d6 100644 --- a/website/source/docs/jobspec/interpreted.html.md +++ b/website/source/docs/jobspec/interpreted.html.md @@ -16,42 +16,45 @@ scheduler has placed them on a particular node. The syntax for interpreting variables is `${variable}`. An example and a comprehensive list of interpretable fields can be seen below: -``` +```hcl task "demo" { - driver = "docker" + driver = "docker" - # Drivers support interpreting node attributes and runtime environment - # variables - config { - image = "my-app" + # Drivers support interpreting node attributes and runtime environment + # variables + config { + image = "my-app" - # Interpret runtime variables to inject the address to bind to and the - # location to write logs to. - args = ["--bind=${NOMAD_ADDR_RPC}", "--logs=${NOMAD_ALLOC_DIR}/logs"] + # Interpret runtime variables to inject the address to bind to and the + # location to write logs to. + args = [ + "--bind", "${NOMAD_ADDR_RPC}", + "--logs", "${NOMAD_ALLOC_DIR}/logs", + ] - port_map { - RPC = 6379 - } + port_map { + RPC = 6379 } + } - # Constraints only support node attributes as runtime environment variables - # are only defined after the task is placed on a node. - constraint { - attribute = "${attr.kernel.name}" - value = "linux" - } + # Constraints only support node attributes as runtime environment variables + # are only defined after the task is placed on a node. + constraint { + attribute = "${attr.kernel.name}" + value = "linux" + } - # Environment variables are interpreted and can contain both runtime and - # node attributes. - env { - "DC" = "Running on datacenter ${node.datacenter}" - "VERSION" = "Version ${NOMAD_META_VERSION}" - } + # Environment variables are interpreted and can contain both runtime and + # node attributes. There environment variables are passed into the task. + env { + "DC" = "Running on datacenter ${node.datacenter}" + "VERSION" = "Version ${NOMAD_META_VERSION}" + } - # Meta keys are also interpretable. - meta { - VERSION = "v0.3" - } + # Meta keys are also interpretable. + meta { + VERSION = "v0.3" + } } ``` @@ -229,4 +232,3 @@ a particular node and as such can not be used in constraints. Interpret an environment variable with key `env_key` set on the task. -