Skip to content

Commit b9221a6

Browse files
author
AJ Bond
committed
Configure cross compile test builds
This issue will setup goreleaser and cross compile kubectl-trace for multiple platforms. This would be a starting point for issue #9
1 parent 9e635f2 commit b9221a6

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
_output/
2+
dist/

.goreleaser.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
project_name: kubectl-trace
2+
builds:
3+
- goos:
4+
- linux
5+
- darwin
6+
- windows
7+
goarch:
8+
- amd64
9+
- 386
10+
main: ./cmd/kubectl-trace
11+
env:
12+
- GO111MODULE=on
13+
- CGO_ENABLED=0
14+
ldflags: |
15+
-X github.com/iovisor/kubectl-trace/pkg/version.buildTime={{ .Timestamp }}
16+
-X github.com/iovisor/kubectl-trace/pkg/version.gitCommit={{ .Commit }}
17+
-X github.com/iovisor/kubectl-trace/pkg/version.imageName={{ .Env.IMAGE_NAME }}
18+
binary: kubectl-trace
19+
- goos:
20+
- linux
21+
- darwin
22+
- windows
23+
goarch:
24+
- amd64
25+
- 386
26+
main: ./cmd/trace-runner
27+
env:
28+
- GO111MODULE=on
29+
- CGO_ENABLED=0
30+
ldflags: |
31+
-X github.com/iovisor/kubectl-trace/pkg/version.buildTime={{ .Timestamp }}
32+
-X github.com/iovisor/kubectl-trace/pkg/version.gitCommit={{ .Commit }}
33+
-X github.com/iovisor/kubectl-trace/pkg/version.imageName={{ .Env.IMAGE_NAME }}
34+
binary: trace-runner
35+
36+
archive:
37+
format_overrides:
38+
- goos: windows
39+
format: zip
40+
41+
snapshot:
42+
name_template: 'master'
43+
44+
release:
45+
disable: true
46+

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ script:
1111
- make _output/bin/kubectl-trace
1212
- ./hack/ci-build-image.sh
1313
- make integration
14+
- make cross
1415
after_success:
1516
- ./hack/ci-release-image.sh

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ ${kubectl_trace}:
3535
${trace_runner}:
3636
CGO_ENABLED=1 $(GO) build ${LDFLAGS} -o $@ ./cmd/trace-runner
3737

38+
.PHONY: releaser
39+
cross:
40+
IMAGE_NAME=$(IMAGE_NAME) go run github.com/goreleaser/goreleaser --snapshot --rm-dist
41+
3842
.PHONY: clean
3943
clean:
40-
rm -Rf _output
44+
$(RM) -R _output
45+
$(RM) -R dist
4146

4247
.PHONY: image/build
4348
image/build:

go.sum

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
1414
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1515
github.com/docker/distribution v2.7.0+incompatible h1:neUDAlf3wX6Ml4HdqTrbcOHXtfRN0TFIwt6YFL7N9RU=
1616
github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
17-
github.com/docker/docker v0.7.3-0.20190105115016-2ee53a42db81 h1:+8pWnXpuAH+W0IkbTfUR2BHYBs5kRrD7wATXA8FwSVQ=
1817
github.com/docker/docker v0.7.3-0.20190105115016-2ee53a42db81/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
1918
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s=
2019
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=

0 commit comments

Comments
 (0)