Documentation/code sample > .gomplate.yaml
example
#1105
-
Hi, I currently have the following command line that works :
But when I try to convert it to a Could you please give a sample that shows how to use Thank you in advance for any help. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @adriens - I've moved this to the Discussions section because this is more of a question than an issue 😉 One way to generate a config file from a given commandline is to run gomplate in verbose mode. It'll print out the YAML form of the configuration that it's about to run. Here's what I get on my system with the same commandline: $ gomplate -V -d data=person.json --file template.tmplt --out OUT.txt
17:01:58 DBG starting gomplate
17:01:58 DBG config is:
---
inputFiles: [template.tmplt]
outputFiles: [OUT.txt]
leftDelim: '{{'
rightDelim: '}}'
datasources:
data:
url: file:///Users/hairyhenderson/person.json
header: {}
pluginTimeout: 5s
build= version=3.9.0
17:01:58 DBG created data from config data="&{ctx:0xc0000aedb0 Sources:map[data:data=file:///Users/hairyhenderson/person.json ()] sourceReaders:map[] cache:map[] extraHeaders:map[]}"
17:01:58 DBG completed rendering duration=0.000340407 errors=0 templatesRendered=1 So, here's a configuration that would work: ---
inputFiles: [template.tmplt]
outputFiles: [OUT.txt]
leftDelim: '{{'
rightDelim: '}}'
datasources:
data:
url: file:///Users/hairyhenderson/person.json
header: {}
pluginTimeout: 5s Some of these values are unnecessary since they're defaults, and the formatting isn't ideal. Here's an equivalent, but more readable version: inputFiles:
- template.tmplt
outputFiles:
- OUT.txt
datasources:
data:
url: person.json Note: I've changed the Hope this explains things for you! Let me know if you have any more questions. |
Beta Was this translation helpful? Give feedback.
-
Hi @hairyhenderson , sorry for late answer... my turn to have a rought week ;-( Thanks a lot for your answer, yes, it perfeclty matches my needs and answers my question. By the way, generatin the file conf in verbose mode is a great idea, I really 💌 the approach. Thanks a lot for your kind answer. Kind Regards, |
Beta Was this translation helpful? Give feedback.
-
Yes, sorry, not yet the habit to deal with GH discussions 😸 |
Beta Was this translation helpful? Give feedback.
Hi @adriens - I've moved this to the Discussions section because this is more of a question than an issue 😉
One way to generate a config file from a given commandline is to run gomplate in verbose mode. It'll print out the YAML form of the configuration that it's about to run. Here's what I get on my system with the same commandline: