-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
command: add render command #13
Conversation
Thanks for this @pmcatominey its awesome; I will try to find some day to take a proper look and merge/give feedback. |
command/render.go
Outdated
flags := c.Meta.FlagSet("build", FlagSetVars) | ||
flags.Usage = func() { c.UI.Output(c.Help()) } | ||
|
||
flags.StringVar(&addr, "address", "", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need address as the render command is not validating the job.
command/render.go
Outdated
flags.Usage = func() { c.UI.Output(c.Help()) } | ||
|
||
flags.StringVar(&addr, "address", "", "") | ||
flags.StringVar(&log, "log-level", "INFO", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doesn't seem like there is any logging except c.UI logs so this can be removed.
command/render.go
Outdated
flags.StringVar(&addr, "address", "", "") | ||
flags.StringVar(&log, "log-level", "INFO", "") | ||
flags.StringVar(&variables, "var-file", "", "") | ||
flags.StringVar(&outPath, "out", "-", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could out default to "" rather than "-"?
command/render.go
Outdated
var err error | ||
var tpl *bytes.Buffer | ||
|
||
flags := c.Meta.FlagSet("build", FlagSetVars) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"render" rather than "build". I will fix the error within the deploy Meta.FlagSet
001e735
to
698bbed
Compare
tpl = bytes.NewBuffer(src) | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this break as it would skip the template call which is necessary to catch any missing interpolations
Render a Nomad job template, useful for debugging. | ||
|
||
General Options: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final thing; it looks like the Help is missing the -var-file variable description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, must have removed that when I culled the other options.
allows testing how the template will be rendered
698bbed
to
fd95da4
Compare
Thanks very much @pmcatominey |
allows testing how the template will be rendered
Fixes #9