Commit Graph

16 Commits

Author SHA1 Message Date
Adrien Delorme ed091163be
HCL2 Parse packer.required_plugins block + packer init (#10304)
This adds the new `required_plugins` block to be nested under the packer block.

Example:
```hcl
packer {
  required_plugins {
    aws = {
      version = ">= 2.7.0"
      source = "azr/aws"
    }
    azure = ">= 2.7.0"
  }
}
```

For example on darwin_amd64 Packer will install those under :
* "${PACKER_HOME_DIR}/plugin/github.com/azr/amazon/packer-plugin-amazon_2.7.0_x5.0_darwin_amd64"
* "${PACKER_HOME_DIR}/plugin/github.com/hashicorp/azure/packer-plugin-azure_2.7.0_x5.0_darwin_amd64_x5"

+ docs
+ tests
2021-02-02 18:05:04 +01:00
Adrien Delorme 52d2d7fe5f
Copy `MapOf...` plugin types back into Packer core (#10466)
* move maps of plugins back in core

* go mod vendor

* more fixes

* fix imports

* Update core_test.go

* fix build

* more fixes

* more fixes

* up vendors after fixing sdk

* Update post_processor_mock.hcl2spec.go

* Leave implementatino of MapOf in the sdk for plugi tests

Other wise use the interface

* go mod tidy

* add MapOfDatasource type too
2021-01-13 12:14:06 +01:00
Megan Marsh 88b7b0e14a remove sdk 2020-12-17 13:29:25 -08:00
Megan Marsh d767c69ed3 rebase and fix conflicts
fix tests
2020-12-03 10:26:48 -08:00
Megan Marsh 5576bb5caa move packer config constants next to the packer config 2020-12-03 10:17:35 -08:00
sylviamoss 2c10c21445 move plugin discover tests to plugin pkg 2020-12-03 17:07:24 +01:00
Megan Marsh 817957fe4f
Merge pull request #8616 from hashicorp/packer-plugin-path
add PACKER_PLUGIN_PATH for plugin discovery
2020-01-28 12:09:55 -08:00
Megan Marsh 6eda9504c9 remove second dir 2020-01-27 16:20:59 -08:00
Megan Marsh 69e7d39fd3 add some tests for packer_plugin_path 2020-01-27 16:19:03 -08:00
nywilken 93640b0854 Update test case for Windows 2020-01-17 14:03:35 -05:00
nywilken c93a076698 config: Update loading of packerconfig to only log when a plugin is loaded
Before this change loading of a packerconfig would display `loaded
plugin ...` for any plugin defined in the packerconfig - even if it
didn't exist on disk. This change updates how plugins defined in
packerconfig are loaded to ensure that only successfully loaded plugins
get the lovely message `loaded plugin ...`. For any plugin that fails to
load Packer will log that it failed to load the plugin and continue
processing any other defined plugins.

* Add a test to ensure loadSingleComponent errors when plugin does not
exists
2020-01-17 13:33:51 -05:00
nywilken fb76323c4d config: Fix loading external plugins from a packerconfig
This change introduces a loadExternalComponent which can be used for
loading a single plugin path. The function is a combination of
the discoverSingle and discoverExternalComponents functions.
2020-01-15 13:08:30 -05:00
Mitchell Hashimoto 7edfb66293 Clean up the configuration loading mechanisms, ditch toml 2013-06-08 22:26:49 -07:00
Mitchell Hashimoto cd5cecfe89 app: support merging configs 2013-05-08 20:40:04 -07:00
Mitchell Hashimoto 085533c17f packer: Test to ensure the default config can parse 2013-05-08 18:14:40 -07:00
Mitchell Hashimoto 5f8330ecc2 Parse/load configs 2013-05-08 18:13:15 -07:00