Packer Plugin paion-data
The paion-data multi-component plugin can be used with HashiCorp Packer to create images
supported by immutable-infrastructure.com. For the full list of available features for this plugin see docs.
Installation
Using pre-built releases
Using the packer init
command
Starting from version 1.7, Packer supports a new packer init
command allowing automatic installation of Packer
plugins. Read the Packer documentation for more information.
To install this plugin, copy and paste this code into Packer configuration. Then, run
packer init
.
packer {
required_plugins {
paion-data = {
version = ">= 0.0.1"
source = "github.com/paion-data/paion-data"
}
}
}
Manual installation
We can find pre-built binary releases of the plugin
here. Once we have downloaded the latest archive
corresponding to our target OS, uncompress it to retrieve the plugin binary file corresponding to our platform. To
install the plugin, please follow the Packer documentation on
installing a plugin.
From Sources
If one prefer to build the plugin from sources, clone the GitHub repository locally and run the command make build
from the root directory. Upon successful compilation, a packer-plugin-paion-data
plugin binary file can be found in
the root directory. To install the compiled plugin, please follow the official Packer documentation on
installing a plugin.
Configuration
For more information on how to configure the plugin, please read the documentation located in the docs/
directory.
Contributing
See CONTRIBUTING.md for best practices and instructions on contributing to paion-data
Plugin.
Developing paion-data Plugin
The Go Workspace
Go expects a single workspace for third-party Go tools installed via go install
. By default, this workspace is located
in $HOME/go
with source code for these tools stored in $HOME/go/src
and the compiled binaries in $HOME/go/bin
. Set
$GOPATH
environment variable to this path first:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
Building from Source
-
Clone this GitHub repository locally:
git clone git@github.com:paion-data/packer-plugin-paion-data.git
cd packer-plugin-paion-data
-
Build the plugin from the root directory:
go build -ldflags="-X github.com/paion-data/packer-plugin-paion-data/version.VersionPrerelease=dev" -o packer-plugin-paion-data
-
After We successfully compile, the packer-plugin-paion-data
plugin binary file is in the root directory.
-
To install the compiled plugin, run the following command
packer plugins install --path packer-plugin-paion-data github.com/paion-data/paion-data
[!TIP]
If executing the packer plugins install
reports an error, please make sure the version of packer
command is the
latest. To upgrade to the latest version, please refer to
Packer's documentation
Running Acceptance Tests
Make sure to install the plugin locally using the steps in Build from source.
Once everything needed is set up, run:
PACKER_ACC=1 go test -count 1 -v ./... -timeout=120m
This will run the acceptance tests for all plugins in this set.
[!CAUTION]
Please make sure the acceptance tests are running against the local version by deleting all previously installed
versions under $HOME/. config/packer/plugins
directory. Otherwise, the tests will pick up the old released version
if they were installed before. Deleting github.com/paion-data/paion-data
, for example, would be
rm -rf ~/.config/packer/plugins/github.com/paion-data/paion-data
Registering Plugin as Packer Integration
Partner and community plugins can be hard to find if a user doesn't know what
they are looking for. To assist with plugin discovery Packer offers an integration
portal at https://developer.hashicorp.com/packer/integrations to list known integrations
that work with the latest release of Packer.
Registering a plugin as an integration requires metadata configuration within the plugin
repository and approval by the Packer team. To initiate the process of registering your
plugin as a Packer integration refer to the Developing Plugins page.
License
The use and distribution terms for [packer-plugin-paion-data] are covered by the Apache License, Version 2.0.