forked from whalebrew/whalebrew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Windows ( whalebrew#29 )
Squashed commit of the following: commit ed225df Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:29:39 2017 +0900 Fix CI commit 94a625d Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:49 2017 +0900 Fix windows installer commit 0bea8fb Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:20 2017 +0900 Fix README for Windows installer commit 237a4a7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 19:11:19 2017 +0900 Fix build for Windows commit bc508d7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:59:16 2017 +0900 Fix to set API version (moby/moby#32779) commit 442be2f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:03:01 2017 +0900 Update README for Windows commit e83b2ed Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:01:01 2017 +0900 Add installer for Windows commit 776b931 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:00:38 2017 +0900 Build for Windows commit bc01aef Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:43 2017 +0900 Fix `run.go` for Windows commit 63b9490 Merge: a72237f 0fea7e2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:01 2017 +0900 Merge tag '0.1.0' of https://github.com/bfirsh/whalebrew into support-windows commit a72237f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:26:29 2017 +0900 Fix `ForceInstall` for windows commit de458d9 Merge: 03d00bf e7d0792 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:22:41 2017 +0900 Merge tag '0.0.5' into support-windows commit 03d00bf Author: 3846masa <3846masahiro+git@gmail.com> Date: Tue Feb 14 00:01:52 2017 +0900 Fix batch file's shebang commit 21bcf14 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 22:19:25 2017 +0900 Fix .travis.yml for forked project commit a0e486c Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:59:19 2017 +0900 Add appveyor.yml commit fe06f35 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:34:46 2017 +0900 MakePackagePath commit bc12aa0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:23:31 2017 +0900 Rewrite test commit 7453d37 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 20:28:33 2017 +0900 `path.Join` -> `filepath.Join` commit 4ded1a2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:53:51 2017 +0900 LF -> CRLF in batch file commit 8078165 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:34:08 2017 +0900 Fix edit for Windows commit 8746496 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:15:55 2017 +0900 Fix run for windows commit bb652d4 Merge: 8a6d783 e7e6427 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:08:42 2017 +0900 Merge v0.0.4 Merge remote-tracking branch 'origin/master' into support-windows commit 8a6d783 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 21:11:59 2017 +0900 Support to run and return status code on Windows commit ce3d298 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:58:21 2017 +0900 Revert "syscall -> exec (for working on windows)" This reverts commit 276a9cd. commit ffbdd15 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:50:08 2017 +0900 Add batch file support (for working on windows) commit cdc5a05 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:34:30 2017 +0900 Revert "Add batch file support (for working on windows)" This reverts commit aba79b0. commit 10e10a0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Feb 3 00:53:23 2017 +0900 Revert "Fix checking args (for working on windows)" This reverts commit 926f422. commit 74db526 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:14:59 2017 +0900 Fix default WHALEBREW_INSTALL_PATH (for working on windows) commit aba79b0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:06:00 2017 +0900 Add batch file support (for working on windows) commit 926f422 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:45:51 2017 +0900 Fix checking args (for working on windows) commit 276a9cd Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:36:56 2017 +0900 syscall -> exec (for working on windows)
- Loading branch information
Showing
14 changed files
with
296 additions
and
52 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
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,35 @@ | ||
version: "{build}" | ||
|
||
os: Windows Server 2012 R2 | ||
|
||
clone_folder: c:\gopath\src\github.com\bfirsh\whalebrew | ||
|
||
environment: | ||
GOPATH: c:\gopath | ||
|
||
artifacts: | ||
- path: build\* | ||
|
||
install: | ||
- set PATH=%GOPATH%\bin;%PATH% | ||
- git submodule update --init --recursive | ||
- go version | ||
- go env | ||
- go get -t ./... | ||
- go get -u github.com/golang/lint/golint | ||
- go get -u github.com/mitchellh/gox | ||
|
||
build_script: | ||
- golint ./... | ||
- go test ./... | ||
- ps: script/build-for-windows.ps1 | ||
|
||
test: off | ||
|
||
deploy: | ||
provider: GitHub | ||
auth_token: | ||
secure: "" | ||
artifact: build\whalebrew-Windows-x86_64.exe | ||
on: | ||
appveyor_repo_tag: true |
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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
package client | ||
|
||
import ( | ||
"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.UpdateClientVersion(DefaultVersion) | ||
cli.NegotiateAPIVersion(context.Background()) | ||
return cli, nil | ||
} |
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
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
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,38 @@ | ||
# Whalebrew Installer for Windows | ||
|
||
try { | ||
$orgErrorActionPreference = $ErrorActionPreference | ||
$ErrorActionPreference = "Stop" | ||
|
||
$VERSION = "0.1.0" | ||
$BINARY_URL = "https://github.com/3846masa/whalebrew/releases/download/$VERSION/whalebrew-Windows-x86_64.exe" | ||
$USER_PATH = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) | ||
$WHALEBREW_INSTALL_PATH = [Environment]::GetEnvironmentVariable("WHALEBREW_INSTALL_PATH", [System.EnvironmentVariableTarget]::User) | ||
|
||
if ($WHALEBREW_INSTALL_PATH -eq $null -or $WHALEBREW_INSTALL_PATH -eq '') { | ||
$WHALEBREW_INSTALL_PATH = 'C:\whalebrew'; | ||
[Environment]::SetEnvironmentVariable("WHALEBREW_INSTALL_PATH", $WHALEBREW_INSTALL_PATH, [System.EnvironmentVariableTarget]::User) | ||
} | ||
|
||
if (![System.IO.Directory]::Exists($WHALEBREW_INSTALL_PATH)) { | ||
[System.IO.Directory]::CreateDirectory($WHALEBREW_INSTALL_PATH) | ||
} | ||
|
||
if ($($USER_PATH).ToLower().Contains($($WHALEBREW_INSTALL_PATH).ToLower()) -eq $false) { | ||
[Environment]::SetEnvironmentVariable("Path", "$USER_PATH;%WHALEBREW_INSTALL_PATH%", [System.EnvironmentVariableTarget]::User) | ||
} | ||
|
||
Write-Output "`nDownloading Whalebrew from : $BINARY_URL" | ||
|
||
$WHALEBREW_PATH = Join-Path $WHALEBREW_INSTALL_PATH "whalebrew.exe" | ||
(New-Object System.Net.WebClient).DownloadFile($BINARY_URL, "$WHALEBREW_PATH") | ||
|
||
Write-Output "`nInstalled whalebrew to `"$WHALEBREW_PATH`"`n" | ||
} | ||
catch { | ||
$Host.UI.WriteErrorLine("`nFailed to install whalebrew...`n") | ||
Write-Error $error[1] | ||
} | ||
finally { | ||
$ErrorActionPreference = $orgErrorActionPreference | ||
} |
Oops, something went wrong.