packer-cn/website/source/docs/builders/file.html.md

54 lines
1.4 KiB
Markdown
Raw Normal View History

2016-08-30 13:51:49 -04:00
---
layout: docs
sidebar_current: docs-builders-file
page_title: File - Builders
description: |-
The file Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times. It does not run any provisioners.
---
2016-08-30 13:51:49 -04:00
# File Builder
Type: `file`
The `file` Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times. It does not run any provisioners.
## Basic Example
Below is a fully functioning example. It doesn't do anything useful, since no
provisioners are defined, but it will connect to the specified host via ssh.
```json
2016-08-30 13:51:49 -04:00
{
"type": "file",
"content": "Lorem ipsum dolor sit amet",
"target": "dummy_artifact"
2016-08-30 13:51:49 -04:00
}
```
## Configuration Reference
Configuration options are organized below into two categories: required and
optional. Within each category, the available options are alphabetized and
described.
Any [communicator](/docs/templates/communicator.html) defined is ignored.
### Required:
- `target` (string) - The path for a file which will be copied as the
2016-08-30 13:51:49 -04:00
artifact.
### Optional:
You can only define one of `source` or `content`. If none of them is
defined the artifact will be empty.
- `source` (string) - The path for a file which will be copied as the
2016-08-30 13:51:49 -04:00
artifact.
- `content` (string) - The content that will be put into the artifact.