Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: configure cross compile test builds #39

Merged
merged 4 commits into from
Sep 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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