2021-03-05 15:44:04 -05:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
|
|
|
|
|
|
|
// Previously core-bundled components, split into their own plugins but
|
|
|
|
// still vendored with Packer for now. Importing as library instead of
|
|
|
|
// forcing use of packer init, until packer v1.8.0
|
2021-03-05 15:27:03 -05:00
|
|
|
exoscaleimportpostprocessor "github.com/exoscale/packer-plugin-exoscale/post-processor/exoscale-import"
|
2021-03-05 15:44:04 -05:00
|
|
|
dockerbuilder "github.com/hashicorp/packer-plugin-docker/builder/docker"
|
|
|
|
dockerimportpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-import"
|
|
|
|
dockerpushpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-push"
|
|
|
|
dockersavepostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-save"
|
|
|
|
dockertagpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-tag"
|
|
|
|
)
|
|
|
|
|
2021-03-05 19:07:32 -05:00
|
|
|
// VendoredBuilders are builder components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
2021-03-05 15:44:04 -05:00
|
|
|
var VendoredBuilders = map[string]packersdk.Builder{
|
|
|
|
"docker": new(dockerbuilder.Builder),
|
|
|
|
}
|
|
|
|
|
2021-03-05 19:07:32 -05:00
|
|
|
// VendoredProvisioners are provisioner components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
2021-03-05 15:44:04 -05:00
|
|
|
var VendoredProvisioners = map[string]packersdk.Provisioner{}
|
|
|
|
|
2021-03-05 19:07:32 -05:00
|
|
|
// VendoredPostProcessors are post-processor components that were once bundled with the
|
|
|
|
// Packer core, but are now being imported from their counterpart plugin repos
|
2021-03-05 15:44:04 -05:00
|
|
|
var VendoredPostProcessors = map[string]packersdk.PostProcessor{
|
2021-03-05 15:27:03 -05:00
|
|
|
"docker-import": new(dockerimportpostprocessor.PostProcessor),
|
|
|
|
"docker-push": new(dockerpushpostprocessor.PostProcessor),
|
|
|
|
"docker-save": new(dockersavepostprocessor.PostProcessor),
|
|
|
|
"docker-tag": new(dockertagpostprocessor.PostProcessor),
|
|
|
|
"exoscale-import": new(exoscaleimportpostprocessor.PostProcessor),
|
2021-03-05 15:44:04 -05:00
|
|
|
}
|
|
|
|
|
2021-03-05 15:27:03 -05:00
|
|
|
// Upon init lets load up any plugins that were vendored manually into the default
|
|
|
|
// set of plugins.
|
2021-03-05 15:44:04 -05:00
|
|
|
func init() {
|
|
|
|
for k, v := range VendoredBuilders {
|
|
|
|
if _, ok := Builders[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
Builders[k] = v
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range VendoredProvisioners {
|
|
|
|
if _, ok := Provisioners[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
Provisioners[k] = v
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range VendoredPostProcessors {
|
|
|
|
if _, ok := PostProcessors[k]; ok {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
PostProcessors[k] = v
|
|
|
|
}
|
|
|
|
}
|