diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..987100cbc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: go + +go: + - 1.9.x + +script: make ci diff --git a/Makefile b/Makefile index be76290ac..e2eb87049 100644 --- a/Makefile +++ b/Makefile @@ -87,6 +87,7 @@ _output/bin/$(GOOS)/$(GOARCH)/$(BIN): build-dirs VERSION=$(VERSION) \ PKG=$(PKG) \ BIN=$(BIN) \ + OUTPUT_DIR=/output/$(GOOS)/$(GOARCH) \ ./hack/build.sh'" TTY := $(shell tty -s && echo "-t") @@ -181,3 +182,8 @@ container-clean: bin-clean: rm -rf .go _output + +ci: + hack/verify-all.sh + hack/test.sh $(SRC_DIRS) + GOOS=$(GOOS) GOARCH=$(GOARCH) VERSION=$(VERSION) PKG=$(PKG) BIN=$(BIN) ./hack/build.sh diff --git a/hack/build.sh b/hack/build.sh index 5d2fb3866..1b1f5f58f 100755 --- a/hack/build.sh +++ b/hack/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2016 The Kubernetes Authors. # @@ -53,7 +53,10 @@ LDFLAGS="-X ${PKG}/pkg/buildinfo.Version=${VERSION}" LDFLAGS="${LDFLAGS} -X ${PKG}/pkg/buildinfo.GitSHA=${GIT_SHA}" LDFLAGS="${LDFLAGS} -X ${PKG}/pkg/buildinfo.GitTreeState=${GIT_TREE_STATE}" -OUTPUT=/output/${GOOS}/${GOARCH}/${BIN} +if [[ -z "${OUTPUT_DIR:-}" ]]; then + OUTPUT_DIR=. +fi +OUTPUT=${OUTPUT_DIR}/${BIN} if [[ "${GOOS}" = "windows" ]]; then OUTPUT="${OUTPUT}.exe" fi diff --git a/hack/test.sh b/hack/test.sh index 5ec8afa02..a990faad5 100755 --- a/hack/test.sh +++ b/hack/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2016 The Kubernetes Authors. # diff --git a/hack/update-generated-clientsets.sh b/hack/update-generated-clientsets.sh index 2490faee7..cd56c22b3 100755 --- a/hack/update-generated-clientsets.sh +++ b/hack/update-generated-clientsets.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARK_ROOT=$(realpath $(dirname ${BASH_SOURCE})/..) +ARK_ROOT=$(dirname ${BASH_SOURCE})/.. BIN=${ARK_ROOT}/_output/bin mkdir -p ${BIN} go build -o ${BIN}/client-gen ./vendor/k8s.io/kubernetes/cmd/libs/go2idl/client-gen diff --git a/hack/update-generated-docs.sh b/hack/update-generated-docs.sh index 909edc656..24725d365 100755 --- a/hack/update-generated-docs.sh +++ b/hack/update-generated-docs.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARK_ROOT=$(realpath $(dirname ${BASH_SOURCE})/..) +ARK_ROOT=$(dirname ${BASH_SOURCE})/.. BIN=${ARK_ROOT}/_output/bin mkdir -p ${BIN} diff --git a/hack/update-generated-informers.sh b/hack/update-generated-informers.sh index 2f4fb0d54..b8a395ff6 100755 --- a/hack/update-generated-informers.sh +++ b/hack/update-generated-informers.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARK_ROOT=$(realpath $(dirname ${BASH_SOURCE})/..) +ARK_ROOT=$(dirname ${BASH_SOURCE})/.. BIN=${ARK_ROOT}/_output/bin mkdir -p ${BIN} diff --git a/hack/update-generated-listers.sh b/hack/update-generated-listers.sh index 968640674..31adfad18 100755 --- a/hack/update-generated-listers.sh +++ b/hack/update-generated-listers.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARK_ROOT=$(realpath $(dirname ${BASH_SOURCE})/..) +ARK_ROOT=$(dirname ${BASH_SOURCE})/.. BIN=${ARK_ROOT}/_output/bin mkdir -p ${BIN} diff --git a/hack/verify-generated-docs.sh b/hack/verify-generated-docs.sh index 7b278604b..d1c800e60 100755 --- a/hack/verify-generated-docs.sh +++ b/hack/verify-generated-docs.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARK_ROOT=$(realpath $(dirname ${BASH_SOURCE})/..) +ARK_ROOT=$(dirname ${BASH_SOURCE})/.. HACK_DIR=$(dirname "${BASH_SOURCE}") DOCS_DIR=${ARK_ROOT}/docs/cli-reference TMP_DIR="$(mktemp -d)"