Merge pull request #7124 from hashicorp/fix_7120

clarify use of split function in docs
This commit is contained in:
Megan Marsh 2018-12-18 10:08:37 -08:00 committed by GitHub
commit 59307d6d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -272,6 +272,11 @@ builder in this example.
The function `split` takes an input string, a seperator string, and a numeric The function `split` takes an input string, a seperator string, and a numeric
component value and returns the requested substring. component value and returns the requested substring.
Please note that you cannot use the `split` function on user variables,
because we can't nest the functions currently. This function is indended to
be used on builder variables like build_name. If you need a split user
variable, the best way to do it is to create a separate variable.
Here are some examples using the above options: Here are some examples using the above options:
``` liquid ``` liquid
@ -292,7 +297,7 @@ this case, on the `fixed-string` value):
"type": "vagrant", "type": "vagrant",
"compression_level": 9, "compression_level": 9,
"keep_input_artifact": false, "keep_input_artifact": false,
"vagrantfile_template": "tpl/{{split build_name \"-\" 1}.rb", "vagrantfile_template": "tpl/{{split build_name \"-\" 1}}.rb",
"output": "output/{{build_name}}.box", "output": "output/{{build_name}}.box",
"only": [ "only": [
"org-name-provider" "org-name-provider"