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

@@ -17,18 +17,21 @@
# This command checks that the built commands can function together for
# simple scenarios. It does not require Docker so it can run in travis.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/util.sh"
source "${KUBE_ROOT}/hack/config-go.sh"
function cleanup()
{
set +e
kill ${APISERVER_PID} 1>&2 2>/dev/null
kill ${CTLRMGR_PID} 1>&2 2>/dev/null
kill ${KUBELET_PID} 1>&2 2>/dev/null
kill ${PROXY_PID} 1>&2 2>/dev/null
kill ${ETCD_PID} 1>&2 2>/dev/null
[[ -n ${APISERVER_PID-} ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null
[[ -n ${CTLRMGR_PID-} ]] && kill ${CTLRMGR_PID} 1>&2 2>/dev/null
[[ -n ${KUBELET_PID-} ]] && kill ${KUBELET_PID} 1>&2 2>/dev/null
[[ -n ${PROXY_PID-} ]] && kill ${PROXY_PID} 1>&2 2>/dev/null
[[ -n ${ETCD_PID-} ]] && kill ${ETCD_PID} 1>&2 2>/dev/null
rm -rf ${ETCD_DIR} 1>&2 2>/dev/null
echo
echo "Complete"