packer.star¶
Bump plugin versions in Packer templates.
Edits are line-based, so comments and alignment in .pkr.hcl files stay as they were.
| Function | What it does |
|---|---|
templates |
Lists the repo's Packer HCL templates. |
set_plugin_version |
Sets the version of a plugin in required_plugins, matched by its source. |
templates¶
Lists the repo's Packer HCL templates.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted paths of every *.pkr.hcl file.
Example
set_plugin_version¶
Sets the version of a plugin in required_plugins, matched by its source.
A newer version already there is kept, so a campaign never lowers one.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
source |
The plugin source, such as github.com/hashicorp/amazon. |
constraint |
The new constraint, such as >= 1.3.3. |
Returns: The list of paths that changed.
Example
set_plugin_version(repo, "github.com/hashicorp/amazon", ">= 1.3.3")
# returns ["images/base.pkr.hcl"]
Used in: packer-plugins