From 46a058572b38435f4d130b3ec75fa66b46b90582 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 23 May 2013 22:38:40 -0700 Subject: [PATCH] provisioner/shell and plugin/provisioner-shell --- plugin/provisioner-shell/main.go | 10 ++++++++++ provisioner/shell/provisioner.go | 22 ++++++++++++++++++++++ provisioner/shell/provisioner_test.go | 15 +++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 plugin/provisioner-shell/main.go create mode 100644 provisioner/shell/provisioner.go create mode 100644 provisioner/shell/provisioner_test.go diff --git a/plugin/provisioner-shell/main.go b/plugin/provisioner-shell/main.go new file mode 100644 index 000000000..c14b11600 --- /dev/null +++ b/plugin/provisioner-shell/main.go @@ -0,0 +1,10 @@ +package main + +import ( + "github.com/mitchellh/packer/provisioner/shell" + "github.com/mitchellh/packer/packer/plugin" +) + +func main() { + plugin.ServeProvisioner(new(shell.Provisioner)) +} diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go new file mode 100644 index 000000000..5561dc93c --- /dev/null +++ b/provisioner/shell/provisioner.go @@ -0,0 +1,22 @@ +// This package implements a provisioner for Packer that executes +// shell scripts within the remote machine. +package shell + +import ( + "github.com/mitchellh/packer/packer" +) + +// TODO(mitchellh): config +type config struct { +} + +type Provisioner struct { + config config +} + +func (p *Provisioner) Prepare(raw interface{}, ui packer.Ui) { +} + +func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) { + ui.Say("PROVISIONING SOME STUFF") +} diff --git a/provisioner/shell/provisioner_test.go b/provisioner/shell/provisioner_test.go new file mode 100644 index 000000000..2f67b0160 --- /dev/null +++ b/provisioner/shell/provisioner_test.go @@ -0,0 +1,15 @@ +package shell + +import ( + "github.com/mitchellh/packer/packer" + "testing" +) + +func TestProvisioner_Impl(t *testing.T) { + var raw interface{} + raw = &Provisioner{} + if _, ok := raw.(packer.Provisioner); !ok { + t.Fatalf("must be a Provisioner") + } +} +