mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
provisioner/shell and plugin/provisioner-shell
This commit is contained in:
parent
84891701bd
commit
46a058572b
3 changed files with 47 additions and 0 deletions
10
plugin/provisioner-shell/main.go
Normal file
10
plugin/provisioner-shell/main.go
Normal file
|
|
@ -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))
|
||||
}
|
||||
22
provisioner/shell/provisioner.go
Normal file
22
provisioner/shell/provisioner.go
Normal file
|
|
@ -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")
|
||||
}
|
||||
15
provisioner/shell/provisioner_test.go
Normal file
15
provisioner/shell/provisioner_test.go
Normal file
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue