From f4f0ab9f5029a464f22fcc159d9fea38b9d6e145 Mon Sep 17 00:00:00 2001 From: Michele Catalano Date: Thu, 24 Dec 2015 23:48:40 +0100 Subject: [PATCH] add integrate lxc builder in packer add lxc with scripts/generate-plugins.go --- command/plugin.go | 6 ++++-- plugin/builder-lxc/main.go | 15 +++++++++++++++ plugin/builder-lxc/main_test.go | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 plugin/builder-lxc/main.go create mode 100644 plugin/builder-lxc/main_test.go diff --git a/command/plugin.go b/command/plugin.go index af2fa2985..2b0d3428c 100644 --- a/command/plugin.go +++ b/command/plugin.go @@ -26,6 +26,8 @@ import ( filebuilder "github.com/hashicorp/packer/builder/file" googlecomputebuilder "github.com/hashicorp/packer/builder/googlecompute" hypervisobuilder "github.com/hashicorp/packer/builder/hyperv/iso" + lxcbuilder "github.com/hashicorp/packer/builder/lxc" + lxdbuilder "github.com/hashicorp/packer/builder/lxd" nullbuilder "github.com/hashicorp/packer/builder/null" oneandonebuilder "github.com/hashicorp/packer/builder/oneandone" openstackbuilder "github.com/hashicorp/packer/builder/openstack" @@ -69,8 +71,6 @@ import ( shelllocalprovisioner "github.com/hashicorp/packer/provisioner/shell-local" windowsrestartprovisioner "github.com/hashicorp/packer/provisioner/windows-restart" windowsshellprovisioner "github.com/hashicorp/packer/provisioner/windows-shell" - - lxdbuilder "github.com/hashicorp/packer/builder/lxd" ) type PluginCommand struct { @@ -78,6 +78,7 @@ type PluginCommand struct { } var Builders = map[string]packer.Builder{ +<<<<<<< HEAD "alicloud-ecs": new(alicloudecsbuilder.Builder), "amazon-chroot": new(amazonchrootbuilder.Builder), "amazon-ebs": new(amazonebsbuilder.Builder), @@ -91,6 +92,7 @@ var Builders = map[string]packer.Builder{ "file": new(filebuilder.Builder), "googlecompute": new(googlecomputebuilder.Builder), "hyperv-iso": new(hypervisobuilder.Builder), + "lxc": new(lxcbuilder.Builder), "lxd": new(lxdbuilder.Builder), "null": new(nullbuilder.Builder), "oneandone": new(oneandonebuilder.Builder), diff --git a/plugin/builder-lxc/main.go b/plugin/builder-lxc/main.go new file mode 100644 index 000000000..8e885232f --- /dev/null +++ b/plugin/builder-lxc/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "github.com/mitchellh/packer/builder/lxc" + "github.com/mitchellh/packer/packer/plugin" +) + +func main() { + server, err := plugin.Server() + if err != nil { + panic(err) + } + server.RegisterBuilder(new(lxc.Builder)) + server.Serve() +} diff --git a/plugin/builder-lxc/main_test.go b/plugin/builder-lxc/main_test.go new file mode 100644 index 000000000..06ab7d0f9 --- /dev/null +++ b/plugin/builder-lxc/main_test.go @@ -0,0 +1 @@ +package main