-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First cut at vagrant post-processor for docker
- Loading branch information
Showing
4 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package vagrant | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/packer/packer" | ||
) | ||
|
||
type DockerProvider struct{} | ||
|
||
func (p *DockerProvider) KeepInputArtifact() bool { | ||
return false | ||
} | ||
|
||
func (p *DockerProvider) 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": "docker"} | ||
|
||
vagrantfile = fmt.Sprintf(dockerVagrantfile) | ||
return | ||
} | ||
|
||
var dockerVagrantfile = ` | ||
Vagrant.configure("2") do |config| | ||
end | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package vagrant | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestDockerProvider_impl(t *testing.T) { | ||
var _ Provider = new(DockerProvider) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters