Skip to content

Commit 207c7c5

Browse files
committed
Add overview, installation, and usage info to README.
1 parent cb0e834 commit 207c7c5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<img align="right" src="https://raw.github.com/cliffano/packer-post-processor-json-updater/master/avatar.jpg" alt="Avatar"/>
2+
3+
[![Build Status](https://secure.travis-ci.org/cliffano/packer-post-processor-json-updater.png?branch=master)](http://travis-ci.org/cliffano/packer-post-processor-json-updater)
4+
5+
Packer Post-Processor JSON Updater
6+
----------------------------------
7+
8+
A Packer Post-Processor plugin for updating JSON files.
9+
10+
This is handy when you want to update one or more JSON files after Packer already finish executing the builders.
11+
12+
An example scenario is when you have several Packer templates where the built image of a template becomes the source of a number of other templates.
13+
14+
Installation
15+
------------
16+
17+
Build `packer-post-processor-json-updater` using `go build` or other build tools, then follow [Packer documentation on installing plugins](https://www.packer.io/docs/extend/plugins.html).
18+
19+
Usage
20+
-----
21+
22+
Add `json-updater` type to Packer template's post-processor section:
23+
24+
"post-processors": [
25+
{
26+
"type": "json-updater",
27+
"ami_id": {
28+
"templates/child_template_1.json": [
29+
"variables.aws_source_ami"
30+
],
31+
"templates/child_template_2.json": [
32+
"variables.aws_source_ami"
33+
]
34+
}
35+
}
36+
]
37+
38+
The above `ami_id` configuration indicates that the ID of the newly created AWS AMI will be set as the value of `variables.aws_source_ami` key in `templates/child_template_1.json` and `templates/child_template_2.json` files.
39+
40+
"variables": {
41+
"aws_source_ami": "<ami_id>"
42+
}

0 commit comments

Comments
 (0)