command/build: build error machine-readable is targetted to the build
This commit is contained in:
parent
869c0b94ff
commit
95682f6dfc
|
@ -188,9 +188,17 @@ func (c Command) Run(env packer.Environment, args []string) int {
|
|||
|
||||
if len(errors) > 0 {
|
||||
env.Ui().Machine("error-count", strconv.FormatInt(int64(len(errors)), 10))
|
||||
|
||||
env.Ui().Error("\n==> Some builds didn't complete successfully and had errors:")
|
||||
for name, err := range errors {
|
||||
env.Ui().Machine("error", name, err.Error())
|
||||
// Create a UI for the machine readable stuff to be targetted
|
||||
ui := &packer.TargettedUi{
|
||||
Target: name,
|
||||
Ui: env.Ui(),
|
||||
}
|
||||
|
||||
ui.Machine("error", err.Error())
|
||||
|
||||
env.Ui().Error(fmt.Sprintf("--> %s: %s", name, err))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,18 +147,15 @@ of `packer build`.
|
|||
</p>
|
||||
</dd>
|
||||
|
||||
<dt>error (2)</dt>
|
||||
<dt>error (1)</dt>
|
||||
<dd>
|
||||
<p>
|
||||
A build error that occurred.
|
||||
A build error that occurred. The target of this output will be
|
||||
the build that had the error.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Data 1: name</strong> - The name of the build that had an error.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Data 2: error</strong> - The error message as a string.
|
||||
<strong>Data 1: error</strong> - The error message as a string.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
|
Loading…
Reference in New Issue