mirror of https://github.com/hashicorp/packer
parent
f409dc54f5
commit
e1ca5c4488
@ -0,0 +1,30 @@
|
||||
package vagrant
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type LxcProvider struct{}
|
||||
|
||||
func (p *LxcProvider) KeepInputArtifact() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *LxcProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) {
|
||||
// Create the metadata
|
||||
metadata = map[string]interface{}{"provider": "lxc"}
|
||||
|
||||
// Copy all of the original contents into the temporary directory
|
||||
for _, path := range artifact.Files() {
|
||||
ui.Message(fmt.Sprintf("Copying: %s", path))
|
||||
|
||||
dstPath := filepath.Join(dir, filepath.Base(path))
|
||||
if err = CopyContents(dstPath, path); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package vagrant
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLxcProvider_impl(t *testing.T) {
|
||||
var _ Provider = new(LxcProvider)
|
||||
}
|
||||
Loading…
Reference in new issue