Skip to content

Commit

Permalink
Configure cross compile test builds
Browse files Browse the repository at this point in the history
This issue will setup goreleaser and cross compile kubectl-trace for multiple platforms. This would be a starting point for issue #9
  • Loading branch information
AJ Bond committed Jan 16, 2019
1 parent 9e635f2 commit c6e5395
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_output/
dist/
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
project_name: kubectl-trace
builds:
- goos:
- linux
- darwin
- windows
goarch:
- amd64
- 386
main: ./cmd/kubectl-trace
env:
- GO111MODULE=on
- CGO_ENABLED=0
ldflags: |
-X github.com/iovisor/kubectl-trace/pkg/version.buildTime={{ .Timestamp }}
-X github.com/iovisor/kubectl-trace/pkg/version.gitCommit={{ .Commit }}
-X github.com/iovisor/kubectl-trace/pkg/version.imageName={{ .Env.IMAGE_NAME }}
binary: kubectl-trace
- goos:
- linux
- darwin
- windows
goarch:
- amd64
- 386
main: ./cmd/trace-runner
env:
- GO111MODULE=on
- CGO_ENABLED=0
ldflags: |
-X github.com/iovisor/kubectl-trace/pkg/version.buildTime={{ .Timestamp }}
-X github.com/iovisor/kubectl-trace/pkg/version.gitCommit={{ .Commit }}
-X github.com/iovisor/kubectl-trace/pkg/version.imageName={{ .Env.IMAGE_NAME }}
binary: trace-runner

archive:
format_overrides:
- goos: windows
format: zip

snapshot:
name_template: 'master'

release:
disable: true

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ script:
- make _output/bin/kubectl-trace
- ./hack/ci-build-image.sh
- make integration
- make cross
after_success:
- ./hack/ci-release-image.sh
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ ${kubectl_trace}:
${trace_runner}:
CGO_ENABLED=1 $(GO) build ${LDFLAGS} -o $@ ./cmd/trace-runner

.PHONY: cross
cross:
IMAGE_NAME=$(IMAGE_NAME) go run github.com/goreleaser/goreleaser --snapshot --rm-dist

.PHONY: clean
clean:
rm -Rf _output
$(RM) -R _output
$(RM) -R dist

.PHONY: image/build
image/build:
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/docker/distribution v2.7.0+incompatible h1:neUDAlf3wX6Ml4HdqTrbcOHXtfRN0TFIwt6YFL7N9RU=
github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.7.3-0.20190105115016-2ee53a42db81 h1:+8pWnXpuAH+W0IkbTfUR2BHYBs5kRrD7wATXA8FwSVQ=
github.com/docker/docker v0.7.3-0.20190105115016-2ee53a42db81/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s=
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
Expand Down

0 comments on commit c6e5395

Please sign in to comment.