You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/packer-plugin-sdk
Megan Marsh 7ef8b290e8
Apply suggestions from code review
5 years ago
..
acctest add extra line before package declaration so this line does not become the synopsis of a package for godoc 5 years ago
adapter add extra line before package declaration so this line does not become the synopsis of a package for godoc 5 years ago
bootcommand add extra line before package declaration so this line does not become the synopsis of a package for godoc 5 years ago
chroot add extra line before package declaration so this line does not become the synopsis of a package for godoc 5 years ago
common add extra line before package declaration so this line does not become the synopsis of a package for godoc 5 years ago
communicator Apply suggestions from code review 5 years ago
filelock more godoc tweaks 5 years ago
guestexec more godoc tweaks 5 years ago
json remove iochan package from sdk, switch to using its descendent, mitchellh/iochan 5 years ago
multistep more package docs 5 years ago
net Apply suggestions from code review 5 years ago
packer Apply suggestions from code review 5 years ago
packerbuilderdata more package docs 5 years ago
pathing more package docs 5 years ago
plugin allow to discover & start packer-plugin-* muliplugin binaries (#10277) 5 years ago
random more package docs 5 years ago
retry more package docs 5 years ago
rpc Apply suggestions from code review 5 years ago
sdk-internals/communicator Apply suggestions from code review 5 years ago
shell add more docs 5 years ago
shell-local add more docs 5 years ago
shutdowncommand add more docs 5 years ago
template add more docs 5 years ago
test-fixtures update tests and website and generated partials to reflect new package format 5 years ago
tmp
useragent add more docs 5 years ago
uuid add more docs 5 years ago
version add more docs 5 years ago
Makefile add makefile and go.mod file to sdk subdir. this'll make it easier to extract when we're ready. TODO: readme 5 years ago
README.md add readme to plugin-sdk subdir 5 years ago
go.mod.example add makefile and go.mod file to sdk subdir. this'll make it easier to extract when we're ready. TODO: readme 5 years ago

README.md

Packer Plugin SDK

This SDK enables building Packer plugins. This allows Packer's users to use both the officially-supported builders, provisioners, and post-processors, and custom in-house solutions.

Packer itself is a tool for building identical machine images for multiple platforms from a single source configuration. You can find more about Packer on its website and its GitHub repository.

Packer CLI Compatibility

Packer v1.7.0 or later is needed for this SDK. Versions of Packer prior to that release are still compatible with third-party plugins, but the plugins should use the plugin tooling from inside earlier versions of Packer to ensure complete API compatibility.

Go Compatibility

The Packer Plugin SDK is built in Go, and uses the support policy of Go as its support policy. The two latest major releases of Go are supported by the SDK.

Currently, that means Go 1.14 or later must be used when building a provider with the SDK.

Getting Started

See the Extending Packer docs for a guided tour of plugin development.

Documentation

See the Extending Packer section on the Packer website.

Packer Scope (Plugins VS Core)

Packer Core

  • acts as an RPC client
  • interacts with the user
  • parses (HCL/JSON) configuration
  • manages build as whole, asks plugin(s) to manage the image lifecycle and modify the image being built.
  • discovers plugin(s) and their versions per configuration
  • manages plugin lifecycles (i.e. spins up & tears down plugin process)
  • passes relevant parts of parsed (valid JSON/HCL) and interpolated configuration to plugin(s)

Packer Provider (via this SDK)

  • acts as RPC server
  • executes any domain-specific logic based on received parsed configuration. For builders this includes managing the vm lifecycle on a give hypervisor or cloud; for provisioners this involves calling the operation on the remote instance.
  • tests domain-specific logic via provided acceptance test framework
  • provides Core with template validation, artifact information, and information about whether the plugin process succeeded or failed.

Migrating to SDK from built-in SDK

Migrating to the standalone SDK v1 is covered on the Plugin SDK section of the website.

Versioning

The Packer Plugin SDK is a Go module versioned using semantic versioning.

Contributing

See .github/CONTRIBUTING.md

License

Mozilla Public License v2.0