Skip to content

Commit

Permalink
add osx build job, static link on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtuna committed Dec 14, 2017
1 parent ad62a7d commit ba0ec7b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
20 changes: 19 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ go_import_path: github.com/kubeapps/kubeapps
env:
global:
VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}
GO_XFLAGS=""

matrix:
include:
- env: TARGET=x86_64-w64-mingw32
- env: TARGET=""
- env: TARGET=x86_64-apple-darwin15-clang

addons:
apt:
packages:
Expand All @@ -33,9 +36,24 @@ script:
export CXX="$TARGET-g++"
export GOOS="windows"
export GOARCH="amd64"
GO_XFLAGS="-ldflags='-extldflags \"-static\"'"
go env
fi
- |
if [ "$TARGET" == "x86_64-apple-darwin15-clang" ]; then
git clone https://github.com/tpoechtrager/osxcross
sudo $PWD/osxcross/tools/get_dependencies.sh
wget -O $PWD/osxcross/tarballs/MacOSX10.11.sdk.tar.xz \
https://storage.googleapis.com/osx-cross-compiler/MacOSX10.11.sdk.tar.xz
UNATTENDED=1 OSX_VERSION_MIN=10.9 $PWD/osxcross/build.sh
export PATH=$PATH:$PWD/osxcross/target/bin/
export CC="$TARGET"
export CXX="$TARGET++"
export GOOS="darwin"
export GOARCH="amd64"
go env
fi
- make VERSION="$VERSION" binary-travis
- make VERSION="$VERSION" GO_XFLAGS="$GO_XFLAGS" binary-travis
- file kubeapps

before_deploy:
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BINARY = kubeapps
GO_PACKAGES = $(IMPORT_PATH)/cmd $(IMPORT_PATH)/pkg/...
GO_FILES := $(shell find $(shell $(GOBIN) list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GO_FLAGS = -ldflags='-w -X github.com/kubeapps/kubeapps/cmd.VERSION=${VERSION}'
GO_XFLAGS =
EMBEDDED_STATIC = generated/statik/statik.go

default: binary
Expand All @@ -19,7 +20,7 @@ binary: build-prep $(EMBEDDED_STATIC)
CGO_ENABLED=1 $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)

binary-travis: build-prep $(EMBEDDED_STATIC)-travis
CGO_ENABLED=1 $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)
CGO_ENABLED=1 $(GO) build -i -o $(BINARY) $(GO_FLAGS) $(GO_XFLAGS) $(IMPORT_PATH)

test: build-prep $(EMBEDDED_STATIC)
$(GO) test $(GO_FLAGS) $(GO_PACKAGES)
Expand Down

0 comments on commit ba0ec7b

Please sign in to comment.