post-processor/vagrant: boilerplate
This commit is contained in:
parent
accc2c27f5
commit
0f0041725e
|
@ -0,0 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/packer/packer/plugin"
|
||||
"github.com/mitchellh/packer/post-processor/vagrant"
|
||||
)
|
||||
|
||||
func main() {
|
||||
plugin.ServePostProcessor(new(vagrant.PostProcessor))
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package vagrant
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/packer/packer"
|
||||
)
|
||||
|
||||
type AWSBoxPostProcessor struct {
|
||||
}
|
||||
|
||||
func (p *AWSBoxPostProcessor) Configure(raw interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *AWSBoxPostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (packer.Artifact, error) {
|
||||
return nil, nil
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package vagrant
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPostProcessor_ImplementsPostProcessor(t *testing.T) {
|
||||
var raw interface{}
|
||||
raw = &AWSBoxPostProcessor{}
|
||||
if _, ok := raw.(packer.PostProcessor); !ok {
|
||||
t.Fatalf("AWS PostProcessor should be a PostProcessor")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// vagrant implements the packer.PostProcessor interface and adds a
|
||||
// post-processor that turns artifacts of known builders into Vagrant
|
||||
// boxes.
|
||||
package vagrant
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/packer/packer"
|
||||
)
|
||||
|
||||
var builtins = map[string]string{
|
||||
"mitchellh.amazonebs": "aws",
|
||||
}
|
||||
|
||||
type Config struct {}
|
||||
|
||||
type PostProcessor struct {
|
||||
config Config
|
||||
}
|
||||
|
||||
func (p *PostProcessor) Configure(raw interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (packer.Artifact, error) {
|
||||
return nil, nil
|
||||
}
|
Loading…
Reference in New Issue