Skip to content

Commit

Permalink
Merge pull request #36 from pecigonzalo/feature/symlink_paths
Browse files Browse the repository at this point in the history
Feature/symlink paths
  • Loading branch information
pecigonzalo authored Jan 23, 2017
2 parents 9f849d6 + 7e30d8e commit 90d3f0c
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Glide
vendor/
.glide/

# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.1.0
IMPROVEMENTS:
* Updated docker-machine deps
* Updated testImport deps
* Fixes #32 (Unable to complete build when .docker folder is on a symlink)

## 1.0.10
IMPROVEMENTS:
* Mount on both /c/Users and /Users for compatibility
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

default: deps test build

deps: clean
deps:
go get github.com/Masterminds/glide
glide install

Expand Down
19 changes: 7 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# appveyor.yml reference : http://www.appveyor.com/docs/appveyor-yml

version: "1.0.10.{build}"
version: "1.1.0.{build}"

# Source Config
pull_requests:
Expand All @@ -12,30 +12,25 @@ clone_folder: c:\gopath\src\github.com\pecigonzalo\docker-machine-vmwareworkstat
clone_depth: 5

# Build host

os: Windows Server 2012 R2

environment:
MSYSTEM: MINGW64
Msys: winsymlink:nativestrict
GOPATH: c:\gopath
Path: c:\go\bin;c:\gopath\bin;C:\msys64\usr\local\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%
matrix:
- GOARCH: 386
GOVERSION: 1.6
- GOARCH: amd64
GOVERSION: 1.6
Path: c:\go\bin;%GOPATH%\bin;C:\msys64\usr\local\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%

init:
- ps: git config --global core.autocrlf input
- pacman -Sy
- pacman -S --noconfirm make wget curl bzr git mercurial subversion
- pacman -S --noconfirm --needed make wget curl

# Build
install:
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-%GOARCH%.msi
- msiexec /i go%GOVERSION%.windows-%GOARCH%.msi /q
- go version
- go env
- ps: echo $env:Path
- make clean
- make deps

cache:
Expand All @@ -50,7 +45,7 @@ test: off

# Deploy
artifacts:
- path: //bin/docker-machine-driver-vmwareworkstation.exe
- path: /bin/docker-machine-driver-vmwareworkstation.exe

deploy:
provider: GitHub
Expand Down
16 changes: 8 additions & 8 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: github.com/pecigonzalo/docker-machine-vmwareworkstation
import:
- package: github.com/docker/machine
version: v0.7.0
version: v0.9.0
subpackages:
- libmachine/drivers
- libmachine/drivers/plugin
Expand All @@ -15,6 +15,6 @@ import:
- ssh
testImport:
- package: github.com/stretchr/testify
version: v1.1.3
version: v1.1.4
subpackages:
- assert
11 changes: 5 additions & 6 deletions workstation.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"io/ioutil"
"net"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
Expand Down Expand Up @@ -193,13 +192,13 @@ func (d *Driver) GetIP() (string, error) {
return ip, nil
}

// GetState returns the current state of the machine.
func (d *Driver) GetState() (state.State, error) {
// VMRUN only tells use if the vm is running or not
vmxp, err := filepath.EvalSymlinks(d.vmxPath())
if err != nil {
if _, err := os.Stat(d.vmxPath()); os.IsNotExist(err) {
return state.Error, err
}
if stdout, _, _ := vmrun("list"); strings.Contains(stdout, vmxp) {
if stdout, _, _ := vmrun("list"); strings.Contains(stdout, d.vmxPath()) {
return state.Running, nil
}
return state.Stopped, nil
Expand Down Expand Up @@ -451,7 +450,7 @@ func (d *Driver) Remove() error {

func (d *Driver) Restart() error {
_, _, err := vmrun("reset", d.vmxPath(), "nogui")

log.Debugf("Mounting Shared Folders...")
var shareName, shareDir, guestFolder, guestCompatLink string // TODO configurable at some point
switch runtime.GOOS {
Expand Down Expand Up @@ -484,7 +483,7 @@ func (d *Driver) Restart() error {
vmrun("-gu", B2DUser, "-gp", B2DPass, "runScriptInGuest", d.vmxPath(), "/bin/sh", command)
}
}

return err
}

Expand Down

0 comments on commit 90d3f0c

Please sign in to comment.