Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
1cf69480
Commit
1cf69480
authored
Jul 19, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1284 from MSOpenTech/master
post-processor/vagrant: hyper-v
parents
882e37a0
abc4350f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
post-processor/vagrant/hyperv.go
post-processor/vagrant/hyperv.go
+30
-0
post-processor/vagrant/post-processor.go
post-processor/vagrant/post-processor.go
+3
-0
No files found.
post-processor/vagrant/hyperv.go
0 → 100644
View file @
1cf69480
package
vagrant
import
(
"fmt"
"github.com/mitchellh/packer/packer"
"path/filepath"
)
type
HypervProvider
struct
{}
func
(
p
*
HypervProvider
)
KeepInputArtifact
()
bool
{
return
false
}
func
(
p
*
HypervProvider
)
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"
:
"hyperv"
}
// 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
}
post-processor/vagrant/post-processor.go
View file @
1cf69480
...
...
@@ -22,6 +22,7 @@ var builtins = map[string]string{
"mitchellh.vmware"
:
"vmware"
,
"pearkes.digitalocean"
:
"digitalocean"
,
"packer.parallels"
:
"parallels"
,
"MSOpenTech.hyperv"
:
"hyperv"
,
}
type
Config
struct
{
...
...
@@ -220,6 +221,8 @@ func providerForName(name string) Provider {
return
new
(
VMwareProvider
)
case
"parallels"
:
return
new
(
ParallelsProvider
)
case
"hyperv"
:
return
new
(
HypervProvider
)
default
:
return
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment