Skip to content

Commit

Permalink
Fix build for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
3846masa committed Sep 7, 2017
1 parent bc508d7 commit 237a4a7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ install:
build_script:
- golint ./...
- go test ./...
- script/build
- ps: script/build-for-windows.ps1

test: off

deploy:
provider: GitHub
GitHub: "build/whalebrew-Windows-x86_64.exe"
auth_token:
secure: ""
artifact: "build/whalebrew-Windows-x86_64.exe"
on:
appveyor_repo_tag: true
10 changes: 3 additions & 7 deletions client/client.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package client

import (
"github.com/docker/docker/api/types"
"context"

"github.com/docker/docker/client"
)

// DefaultVersion is the Engine API version used by Whalebrew
const DefaultVersion string = "1.20"

// NewClient returns a Docker client configured for Whalebrew
func NewClient() (*client.Client, error) {
cli, err := client.NewEnvClient()
if err != nil {
return cli, err
}
cli.NegotiateAPIVersionPing(types.Ping{
APIVersion: DefaultVersion,
})
cli.NegotiateAPIVersion(context.Background())
return cli, nil
}
4 changes: 2 additions & 2 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e

mkdir -p build
cd build
gox -osarch="linux/amd64" -osarch="darwin/amd64" --osarch="windows/amd64" ../

gox -osarch="linux/amd64" -osarch="darwin/amd64" ../

mv whalebrew_linux_amd64 whalebrew-Linux-x86_64
mv whalebrew_darwin_amd64 whalebrew-Darwin-x86_64
mv whalebrew_windows_amd64.exe whalebrew-Windows-x86_64.exe
6 changes: 6 additions & 0 deletions script/build-for-windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
New-Item -ItemType Directory -Path ./build
Set-Location ./build

gox -osarch="windows/amd64" ../

Move-Item whalebrew_windows_amd64.exe whalebrew-Windows-x86_64.exe

0 comments on commit 237a4a7

Please sign in to comment.