packer-cn/website/source/docs/machine-readable/command-build.html.markdown

2.9 KiB

layout page_title
docs_machine_readable Command: build - Machine-Readable Reference

Build Command Types

These are the machine-readable types that exist as part of the output of packer build.

artifact (>= 2)

Information about an artifact of the targetted item. This is a fairly complex (but uniform!) machine-readable type that contains subtypes. The subtypes are documented within this page in the syntax of "artifact subtype: SUBTYPE". The number of arguments within that subtype is in addition to the artifact args.

	<p>
	<strong>Data 1: index</strong> - The zero-based index of the
	artifact being described. This goes up to "artifact-count" (see
	below).
	</p>
	<p>
	<strong>Data 2: subtype</strong> - The subtype that describes
	the remaining arguments. See the documentation for the
	subtype docs throughout this page.
	</p>
	<p>
	<strong>Data 3..n: subtype data</strong> - Zero or more additional
	data points related to the subtype. The exact count and meaning
	of this subtypes comes from the subtype documentation.
	</p>
</dd>

<dt>artifact-count (1)</dt>
<dd>
	<p>
	The number of artifacts associated with the given target.
	</p>

	<p>
	<strong>Data 1: count</strong> - The number of artifacts as
	a base 10 integer.
	</p>
</dd>

<dt>artifact subtype: builder-id (1)</dt>
<dd>
	<p>
	The unique ID of the builder that created this artifact.
	</p>

	<p>
	<strong>Data 1: id</strong> - The unique ID of the builder.
	</p>
</dd>

<dt>artifact subtype: file (2)</dt>
<dd>
	<p>
	A single file associated with the artifact. There are 0 to
	"files-count" of these entries to describe every file that is
	part of the artifact.
	</p>

	<p>
	<strong>Data 1: index</strong> - Zero-based index of the file.
	This goes from 0 to "files-count" minus one.
	</p>

	<p>
	<strong>Data 2: filename</strong> - The filename.
	</p>
</dd>

<dt>artifact subtype: files-count (1)</dt>
<dd>
	<p>
	The number of files associated with this artifact. Not all
	artifacts have files associated with it.
	</p>

	<p>
	<strong>Data 1: count</strong> - The number of files.
	</p>
</dd>

<dt>artifact subtype: id (1)</dt>
<dd>
	<p>
	The ID (if any) of the artifact that was built. Not all artifacts
	have associated IDs. For example, AMIs built have IDs associated
	with them, but VirtualBox images do not. The exact format of the ID
	is specific to the builder.
	</p>

	<p>
	<strong>Data 1: id</strong> - The ID of the artifact.
	</p>
</dd>

<dt>artifact subtype: nil (0)</dt>
<dd>
	<p>
	If present, this means that the artifact was nil, or that the targetted
	build completed successfully but no artifact was created.
	</p>
</dd>

<dt>artifact subtype: string (1)</dt>
<dd>
	<p>
	The human-readable string description of the artifact provided by
	the artifact itself.
	</p>

	<p>
	<strong>Data 1: string</strong> - The string output for the artifact.
	</p>
</dd>