2016-08-30 13:51:49 -04:00
|
|
|
---
|
2017-06-14 21:04:16 -04:00
|
|
|
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
|
2019-04-08 07:40:02 -04:00
|
|
|
wait times.
|
2016-08-30 13:51:49 -04:00
|
|
|
layout: docs
|
2017-06-14 21:04:16 -04:00
|
|
|
page_title: 'File - Builders'
|
|
|
|
sidebar_current: 'docs-builders-file'
|
2017-03-25 18:13:52 -04:00
|
|
|
---
|
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
|
2019-04-08 07:40:02 -04:00
|
|
|
wait times.
|
2016-08-30 13:51:49 -04:00
|
|
|
|
|
|
|
## Basic Example
|
|
|
|
|
2019-10-03 06:36:10 -04:00
|
|
|
Below is a fully functioning example. It create a file at `target` with the
|
|
|
|
specified `content`.
|
2016-08-30 13:51:49 -04:00
|
|
|
|
2020-03-12 10:05:08 -04:00
|
|
|
```json
|
2016-08-30 13:51:49 -04:00
|
|
|
{
|
2017-03-25 18:13:52 -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:
|
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `target` (string) - The path for a file which will be copied as the
|
2016-08-30 13:51:49 -04:00
|
|
|
artifact.
|
|
|
|
|
|
|
|
### Optional:
|
|
|
|
|
2018-10-26 20:02:51 -04:00
|
|
|
You can only define one of `source` or `content`. If none of them is defined
|
|
|
|
the artifact will be empty.
|
2016-08-30 13:51:49 -04:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `source` (string) - The path for a file which will be copied as the
|
2016-08-30 13:51:49 -04:00
|
|
|
artifact.
|
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `content` (string) - The content that will be put into the artifact.
|