The interface for building a plugin through the test suite was confusing, as it would build the plugin and return its path, cache the path for the version built, and return the path regardless if something was built or not. While in the current state this is harmless as builds are idempotent, since the state of the plugin package/module does not change, this will in the future as we introduce customisation techniques on the plugin's directory and files, making this double-use potentially dangerous. Furthermore, the current behaviour is unclear, as the function hides that caching mechanism, which could come as a surprise for users attempting to build a plugin for the duration of a test, while the built plugin is linked to the test suite being run, and not the unit test being evaluated. Therefore this commit changes the sequence in which plugins are built and used. Now the `CompilePlugin` function builds a plugin, and does not return its path anymore, instead terminating the tests immediately if they fail. In normal test usage, a new `GetPluginPath` function is introduced, which looks-up the path in the suite's cache, failing immediately if invoked before the plugin is built. With this change, it is heavily advised to build plugins when initialising the suite, then in the tests, the GetPluginPath function should be used to get a plugin's path for interacting with packer commands. |
||
|---|---|---|
| .github | ||
| .release | ||
| acctest | ||
| builder | ||
| cmd | ||
| command | ||
| contrib/zsh-completion | ||
| datasource | ||
| examples | ||
| fix | ||
| hcl2template | ||
| helper | ||
| internal/hcp | ||
| packer | ||
| packer_test | ||
| post-processor | ||
| provisioner | ||
| scripts | ||
| version | ||
| website | ||
| .copywrite.hcl | ||
| .gitattributes | ||
| .gitignore | ||
| .go-version | ||
| .golangci.yml | ||
| background_check.go | ||
| background_check_openbsd.go | ||
| CHANGELOG.md | ||
| checkpoint.go | ||
| CODEOWNERS | ||
| commands.go | ||
| config.go | ||
| config_test.go | ||
| Dockerfile | ||
| go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| log.go | ||
| main.go | ||
| main_test.go | ||
| Makefile | ||
| panic.go | ||
| README.md | ||
| tty.go | ||
| tty_solaris.go | ||
| Vagrantfile | ||
Packer
Packer is a tool for building identical machine images for multiple platforms from a single source configuration.
Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer supports various platforms through external plugin integrations, the full list of which can be found at https://developer.hashicorp.com/packer/integrations.
The images that Packer creates can easily be turned into Vagrant boxes.
Quick Start
Packer
There is a great introduction and getting started guide for building a Docker image on your local machine without using any paid cloud resources.
Alternatively, you can refer to getting started with AWS to learn how to build a machine image for an external cloud provider.
HCP Packer
HCP Packer registry stores Packer image metadata, enabling you to track your image lifecycle.
To get started with building an AWS machine image to HCP Packer for referencing in Terraform refer to the collection of HCP Packer Tutorials.
Documentation
Comprehensive documentation is viewable on the Packer website at https://developer.hashicorp.com/packer/docs.
Contributing to Packer
See CONTRIBUTING.md for best practices and instructions on setting up your development environment to work on Packer.
Unmaintained Plugins
As contributors' circumstances change, development on a community maintained plugin can slow. When this happens, HashiCorp may use GitHub's option to archive the plugin’s repository, to clearly signal the plugin's status to users.
What does unmaintained mean?
- The code repository and all commit history will still be available.
- Documentation will remain on the Packer website.
- Issues and pull requests are monitored as a best effort.
- No active development will be performed by HashiCorp.
If you are interested in maintaining an unmaintained or archived plugin, please reach out to us at packer@hashicorp.com.