Set shell options for reliability.

Tweak a few other small things in our shell scripts.
This commit is contained in:
Joe Beda
2014-10-06 13:25:27 -07:00
parent d43a6ec5a3
commit 96c1bc17ca
37 changed files with 304 additions and 198 deletions

View File

@@ -46,18 +46,20 @@ function kube::build::make_binary() {
}
function kube::build::make_binaries() {
if [[ ${#targets[@]} -eq 0 ]]; then
targets=(
cmd/proxy
cmd/apiserver
cmd/controller-manager
cmd/kubelet
cmd/kubecfg
plugin/cmd/scheduler
)
local -a targets=(
cmd/proxy
cmd/apiserver
cmd/controller-manager
cmd/kubelet
cmd/kubecfg
plugin/cmd/scheduler
)
if [[ -n "${1-}" ]]; then
targets=("$1")
fi
binaries=()
local -a binaries=()
local target
for target in "${targets[@]}"; do
binaries+=("${KUBE_GO_PACKAGE}/${target}")
@@ -66,11 +68,6 @@ function kube::build::make_binaries() {
ARCH_TARGET="${KUBE_TARGET}/${GOOS}/${GOARCH}"
mkdir -p "${ARCH_TARGET}"
if [[ -n "$1" ]]; then
kube::build::make_binary "$1"
exit 0
fi
local b
for b in "${binaries[@]}"; do
kube::build::make_binary "$b"

View File

@@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"

View File

@@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"

View File

@@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"

View File

@@ -14,14 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/build/build-image/common.sh"
echo "+++ Running unit tests"
if [[ -n "$1" ]]; then
if [[ -n "${1-}" ]]; then
godep go test -cover -coverprofile=tmp.out "$KUBE_GO_PACKAGE/$1"
exit 0
fi