Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
84d91c5f
Commit
84d91c5f
authored
Aug 27, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/build: put build errors in machine readable output
parent
87dde464
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
command/build/command.go
command/build/command.go
+2
-0
website/source/docs/machine-readable/command-build.html.markdown
.../source/docs/machine-readable/command-build.html.markdown
+31
-1
No files found.
CHANGELOG.md
View file @
84d91c5f
...
...
@@ -14,6 +14,7 @@ IMPROVEMENTS:
*
core: Output message when Ctrl-C received that we're cleaning up. [GH-338]
*
builder/amazon: Tagging now works with all amazon builder types.
*
command/build: Machine-readable output now contains build errors, if any.
BUG FIXES:
...
...
command/build/command.go
View file @
84d91c5f
...
...
@@ -187,8 +187,10 @@ 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
())
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"--> %s: %s"
,
name
,
err
))
}
}
...
...
website/source/docs/machine-readable/command-build.html.markdown
View file @
84d91c5f
...
...
@@ -39,7 +39,9 @@ of `packer build`.
<dt>artifact-count (1)</dt>
<dd>
<p>
The number of artifacts associated with the given target.
The number of artifacts associated with the given target. This
will always be outputted _before_ any other artifact information,
so you're able to know how many upcoming artifacts to look for.
</p>
<p>
...
...
@@ -122,4 +124,32 @@ of `packer build`.
<strong>Data 1: string</strong> - The string output for the artifact.
</p>
</dd>
<dt>error-count (1)</dt>
<dd>
<p>
The number of errors that occurred during the build. This will
always be outputted before any errors so you know how many are coming.
</p>
<p>
<strong>Data 1: count</strong> - The number of build errors as
a base 10 integer.
</p>
</dd>
<dt>error (2)</dt>
<dd>
<p>
A build error that occurred.
</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.
</p>
</dd>
</dl>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment