Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Update dependencies + support for compiling on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sclevine committed Mar 20, 2017
1 parent cf13276 commit 0301266
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/cflocal
/cflocal-*
/out
.droplet
.DS_Store
.idea
Expand Down
35 changes: 13 additions & 22 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,31 @@
url = https://gopkg.in/yaml.v2
[submodule "vendor/github.com/docker/docker"]
path = vendor/github.com/docker/docker
url = https://github.com/docker/docker
[submodule "vendor/github.com/Sirupsen/logrus"]
path = vendor/github.com/Sirupsen/logrus
url = https://github.com/Sirupsen/logrus
url = https://github.com/sclevine/docker
[submodule "vendor/github.com/docker/go-connections"]
path = vendor/github.com/docker/go-connections
url = https://github.com/docker/go-connections
[submodule "vendor/github.com/docker/go-units"]
path = vendor/github.com/docker/go-units
url = https://github.com/docker/go-units
[submodule "vendor/github.com/opencontainers/runc"]
path = vendor/github.com/opencontainers/runc
url = https://github.com/opencontainers/runc
[submodule "vendor/github.com/pkg/errors"]
path = vendor/github.com/pkg/errors
url = https://github.com/pkg/errors
[submodule "vendor/golang.org/x/net"]
path = vendor/golang.org/x/net
url = https://github.com/golang/net
[submodule "vendor/github.com/docker/distribution"]
path = vendor/github.com/docker/distribution
url = https://github.com/docker/distribution
[submodule "vendor/github.com/nu7hatch/gouuid"]
path = vendor/github.com/nu7hatch/gouuid
url = https://github.com/nu7hatch/gouuid
[submodule "vendor/github.com/fatih/color"]
path = vendor/github.com/fatih/color
url = https://github.com/fatih/color
[submodule "vendor/github.com/mattn/go-colorable"]
path = vendor/github.com/mattn/go-colorable
url = https://github.com/mattn/go-colorable
[submodule "vendor/github.com/mattn/go-isatty"]
path = vendor/github.com/mattn/go-isatty
url = https://github.com/mattn/go-isatty
[submodule "vendor/golang.org/x/crypto"]
path = vendor/golang.org/x/crypto
url = https://github.com/golang/crypto
[submodule "vendor/github.com/Sirupsen/logrus"]
path = vendor/github.com/Sirupsen/logrus
url = https://github.com/Sirupsen/logrus
[submodule "vendor/github.com/opencontainers/runc"]
path = vendor/github.com/opencontainers/runc
url = https://github.com/docker/runc
[submodule "vendor/github.com/Microsoft/go-winio"]
path = vendor/github.com/Microsoft/go-winio
url = https://github.com/Microsoft/go-winio
[submodule "vendor/golang.org/x/sys"]
path = vendor/golang.org/x/sys
url = http://github.com/golang/sys
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.2
16 changes: 16 additions & 0 deletions bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

cd $(dirname "${BASH_SOURCE[0]}")/..

mkdir -p out

os_list=(darwin linux windows)
out_list=(macos linux windows.exe)
version=${1:-$(<VERSION)}

for ((i=0; i < ${#os_list[@]}; i++)); do
echo "Building plugin for ${os_list[i]}..."
GOOS=${os_list[i]} go build -ldflags "-X main.Version=$version" -o "out/cflocal-$version-${out_list[i]}" .
done
2 changes: 1 addition & 1 deletion cf/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Stager interface {

//go:generate mockgen -package mocks -destination mocks/runner.go github.com/sclevine/cflocal/cf/cmd Runner
type Runner interface {
Run(config *local.RunConfig, color local.Colorizer) (status int, err error)
Run(config *local.RunConfig, color local.Colorizer) (status int64, err error)
Export(config *local.ExportConfig, reference string) (imageID string, err error)
}

Expand Down
4 changes: 2 additions & 2 deletions cf/cmd/mocks/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func (_mr *_MockRunnerRecorder) Export(arg0, arg1 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "Export", arg0, arg1)
}

func (_m *MockRunner) Run(_param0 *local.RunConfig, _param1 local.Colorizer) (int, error) {
func (_m *MockRunner) Run(_param0 *local.RunConfig, _param1 local.Colorizer) (int64, error) {
ret := _m.ctrl.Call(_m, "Run", _param0, _param1)
ret0, _ := ret[0].(int)
ret0, _ := ret[0].(int64)
ret1, _ := ret[1].(error)
return ret0, ret1
}
Expand Down
2 changes: 1 addition & 1 deletion cf/cmd/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var _ = Describe("Run", func() {
Services: forwardedServices,
},
}, gomock.Any()).Return(
0, nil,
int64(0), nil,
).Do(func(_ *local.RunConfig, c local.Colorizer) {
Expect(c("some-text")).To(Equal(color.GreenString("some-text")))
}),
Expand Down
6 changes: 3 additions & 3 deletions local/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type RunConfig struct {
AppConfig *AppConfig
}

func (r *Runner) Run(config *RunConfig, color Colorizer) (status int, err error) {
func (r *Runner) Run(config *RunConfig, color Colorizer) (status int64, err error) {
if err := r.pull(); err != nil {
return 0, err
}
Expand Down Expand Up @@ -188,7 +188,7 @@ func (r *Runner) Export(config *ExportConfig, reference string) (imageID string,
}

func (r *Runner) pull() error {
body, err := r.Docker.ImagePull(context.Background(), "cloudfoundry/cflinuxfs2:" + r.StackVersion, types.ImagePullOptions{})
body, err := r.Docker.ImagePull(context.Background(), "cloudfoundry/cflinuxfs2:"+r.StackVersion, types.ImagePullOptions{})
if err != nil {
return err
}
Expand Down Expand Up @@ -278,7 +278,7 @@ func (r *Runner) buildContainerConfig(config *AppConfig, forwardConfig *service.
return &container.Config{
Hostname: "cflocal",
User: "vcap",
ExposedPorts: map[nat.Port]struct{}{"8080/tcp": {}},
ExposedPorts: nat.PortSet(map[nat.Port]struct{}{"8080/tcp": {}}),
Env: mapToEnv(mergeMaps(env, config.RunningEnv, config.Env)),
Image: "cloudfoundry/cflinuxfs2:" + r.StackVersion,
WorkingDir: "/home/vcap/app",
Expand Down
2 changes: 1 addition & 1 deletion local/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ var _ = Describe("Runner", func() {
}
status, err := runner.Run(config, percentColor)
Expect(err).NotTo(HaveOccurred())
Expect(status).To(Equal(137))
Expect(status).To(Equal(int64(137)))

Expect(logs.Contents()).To(MatchRegexp(`\[some-app\] % \S+ Forwarding: some-name some-other-name`))
Expect(logs.Contents()).To(MatchRegexp(
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/Microsoft/go-winio
Submodule go-winio added at fff283
2 changes: 1 addition & 1 deletion vendor/github.com/Sirupsen/logrus
Submodule logrus updated 2 files
+4 −0 README.md
+7 −4 text_formatter.go
1 change: 0 additions & 1 deletion vendor/github.com/docker/distribution
Submodule distribution deleted from 99cb7c
2 changes: 1 addition & 1 deletion vendor/github.com/docker/docker
Submodule docker updated 3905 files
1 change: 0 additions & 1 deletion vendor/github.com/docker/go-units
Submodule go-units deleted from f2145d
2 changes: 1 addition & 1 deletion vendor/github.com/fatih/color
Submodule color updated 204 files
2 changes: 1 addition & 1 deletion vendor/github.com/hashicorp/go-version
Submodule go-version updated 2 files
+41 −14 version.go
+27 −0 version_test.go
2 changes: 1 addition & 1 deletion vendor/github.com/kardianos/osext
1 change: 0 additions & 1 deletion vendor/github.com/mattn/go-colorable
Submodule go-colorable deleted from 6c903f
1 change: 0 additions & 1 deletion vendor/github.com/mattn/go-isatty
Submodule go-isatty deleted from 66b8e7
2 changes: 1 addition & 1 deletion vendor/github.com/onsi/ginkgo
Submodule ginkgo updated 53 files
+1 −1 .travis.yml
+1 −1 README.md
+15 −4 ginkgo/bootstrap_command.go
+4 −2 ginkgo/generate_command.go
+8 −3 ginkgo/main.go
+2 −1 ginkgo/suite_runner.go
+10 −8 ginkgo/watch_command.go
+5 −6 integration/coverage_test.go
+28 −11 integration/run_test.go
+30 −0 integration/subcommand_test.go
+0 −2 internal/leafnodes/shared_runner_test.go
+4 −5 internal/remote/aggregator.go
+6 −2 internal/remote/aggregator_test.go
+23 −3 internal/remote/server.go
+3 −18 internal/spec/specs.go
+0 −48 internal/spec/specs_test.go
+1 −1 internal/spec_iterator/index_computer.go
+2 −2 internal/spec_iterator/index_computer_test.go
+60 −0 internal/spec_iterator/parallel_spec_iterator.go
+112 −0 internal/spec_iterator/parallel_spec_iterator_test.go
+45 −0 internal/spec_iterator/serial_spec_iterator.go
+64 −0 internal/spec_iterator/serial_spec_iterator_test.go
+47 −0 internal/spec_iterator/sharded_parallel_spec_iterator.go
+62 −0 internal/spec_iterator/sharded_parallel_spec_iterator_test.go
+20 −0 internal/spec_iterator/spec_iterator.go
+13 −0 internal/spec_iterator/spec_iterator_suite_test.go
+79 −19 internal/specrunner/spec_runner.go
+8 −23 internal/specrunner/spec_runner_test.go
+18 −6 internal/suite/suite.go
+6 −37 internal/suite/suite_test.go
+5 −0 internal/writer/fake_writer.go
+12 −2 internal/writer/writer.go
+3 −2 reporters/default_reporter.go
+2 −3 reporters/default_reporter_test.go
+7 −3 reporters/junit_reporter.go
+6 −6 reporters/stenographer/console_logging.go
+6 −2 reporters/stenographer/fake_stenographer.go
+25 −9 reporters/stenographer/stenographer.go
+6 −0 reporters/stenographer/support/README.md
+21 −0 reporters/stenographer/support/go-colorable/LICENSE
+43 −0 reporters/stenographer/support/go-colorable/README.md
+24 −0 reporters/stenographer/support/go-colorable/colorable_others.go
+783 −0 reporters/stenographer/support/go-colorable/colorable_windows.go
+57 −0 reporters/stenographer/support/go-colorable/noncolorable.go
+9 −0 reporters/stenographer/support/go-isatty/LICENSE
+37 −0 reporters/stenographer/support/go-isatty/README.md
+2 −0 reporters/stenographer/support/go-isatty/doc.go
+9 −0 reporters/stenographer/support/go-isatty/isatty_appengine.go
+18 −0 reporters/stenographer/support/go-isatty/isatty_bsd.go
+18 −0 reporters/stenographer/support/go-isatty/isatty_linux.go
+16 −0 reporters/stenographer/support/go-isatty/isatty_solaris.go
+19 −0 reporters/stenographer/support/go-isatty/isatty_windows.go
+13 −0 types/types.go
2 changes: 1 addition & 1 deletion vendor/github.com/opencontainers/runc
Submodule runc updated from 02f8fa to a01daf
1 change: 0 additions & 1 deletion vendor/github.com/pkg/errors
Submodule errors deleted from 839d9e
2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto
Submodule crypto updated 1 files
+4 −0 pkcs12/pkcs12.go
1 change: 1 addition & 0 deletions vendor/golang.org/x/sys
Submodule sys added at 8f0908

0 comments on commit 0301266

Please sign in to comment.