Skip to content

Commit

Permalink
build: configure cross compile test builds (#39)
Browse files Browse the repository at this point in the history
Configure cross compile test builds
  • Loading branch information
fntlnz authored Sep 15, 2019
2 parents 6bf805d + f812093 commit 544f59d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_output/
dist/
52 changes: 52 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
project_name: kubectl-trace
before:
hooks:
- go mod tidy
builds:
- id: "kubectl-trace"
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
- id: "trace-runner"
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

archives:
- id: windows
format_overrides:
- goos: windows
format: zip

snapshot:
name_template: 'master'

release:
github:
prerelease: auto
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ go:
- 1.11.4
services:
- docker
before_install:
- curl -LO https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_amd64.deb && sudo dpkg -i goreleaser_amd64.deb
script:
- make test
- make _output/bin/kubectl-trace
- ./hack/ci-build-image.sh
- make integration
- make cross
after_success:
- ./hack/ci-release-image.sh

deploy:
- provider: script
skip_cleanup: true
script: goreleaser
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ ${kubectl_trace}:
${trace_runner}:
CGO_ENABLED=1 $(GO) build ${LDFLAGS} -o $@ ./cmd/trace-runner

.PHONY: cross
cross:
IMAGE_NAME=$(IMAGE_NAME) GO111MODULE=on goreleaser --snapshot --rm-dist

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

.PHONY: image/build-init
image/build-init:
Expand Down

0 comments on commit 544f59d

Please sign in to comment.