Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Revert "Create driver model and refactor virtualbox dependencies into dr... #199

Merged
merged 1 commit into from
Jul 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
259 changes: 228 additions & 31 deletions cmds.go

Large diffs are not rendered by default.

45 changes: 41 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,50 @@ import (
"runtime"

toml "github.com/BurntSushi/toml"
"github.com/boot2docker/boot2docker-cli/driver"
vbx "github.com/boot2docker/boot2docker-cli/virtualbox"
flag "github.com/ogier/pflag"
)

// boot2docker config.
var B2D struct {
// NOTE: separate sections with blank lines so gofmt doesn't change
// indentation all the time.

// Gereral flags.
Verbose bool
VBM string

// basic config
SSH string // SSH client executable
SSHGen string // SSH keygen executable
SSHKey string // SSH key to send to the vm
VM string // virtual machine name
Dir string // boot2docker directory
ISO string // boot2docker ISO image path
VMDK string // base VMDK to use as persistent disk
DiskSize uint // VM disk image size (MB)
Memory uint // VM memory size (MB)

// NAT network: port forwarding
SSHPort uint16 // host SSH port (forward to port 22 in VM)
DockerPort uint16 // host Docker port (forward to port 2375 in VM)

// host-only network
HostIP net.IP
DHCPIP net.IP
NetMask net.IPMask
LowerIP net.IP
UpperIP net.IP
DHCPEnabled bool

// Serial console pipe/socket
Serial bool
SerialFile string
}

var (
// Pattern to parse a key=value line in config profile.
reFlagLine = regexp.MustCompile(`^\s*(\w+)\s*=\s*([^#;]+)`)
B2D = driver.MachineConfig{}
)

func getCfgDir(name string) (string, error) {
Expand Down Expand Up @@ -88,10 +124,8 @@ func config() (*flag.FlagSet, error) {
}
vbm = filepath.Join(p, "VBoxManage.exe")
}
flags.BoolVarP(&B2D.Init, "init", "i", false, "auto initialize vm instance.")
flags.StringVar(&B2D.VBM, "vbm", vbm, "path to VirtualBox management utility.")
flags.BoolVarP(&B2D.Verbose, "verbose", "v", false, "display verbose command invocations.")
flags.StringVar(&B2D.Driver, "driver", "virtualbox", "hypervisor driver.")
flags.StringVar(&B2D.SSH, "ssh", "ssh", "path to SSH client utility.")
flags.StringVar(&B2D.SSHGen, "ssh-keygen", "ssh-keygen", "path to ssh-keygen utility.")

Expand Down Expand Up @@ -140,6 +174,9 @@ func config() (*flag.FlagSet, error) {
return nil, err
}

vbx.Verbose = B2D.Verbose
vbx.VBM = B2D.VBM

if B2D.SerialFile == "" {
if runtime.GOOS == "windows" {
//SerialFile ~~ filepath.Join(dir, B2D.vm+".sock")
Expand Down
39 changes: 0 additions & 39 deletions driver/config.go

This file was deleted.

12 changes: 0 additions & 12 deletions driver/dhcp.go

This file was deleted.

76 changes: 0 additions & 76 deletions driver/driver.go

This file was deleted.

157 changes: 0 additions & 157 deletions dummy/machine.go

This file was deleted.

Loading