From: Chris Jaekl Date: Sun, 13 Dec 2015 05:31:11 +0000 (+0900) Subject: Improve jenkins_invoke.sh X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=48411bd8212ee8aafbdcb54d1fae86755387e427;p=cfb.git Improve jenkins_invoke.sh --- diff --git a/jenkins_invoke.sh b/jenkins_invoke.sh index d3e1b00..da49f02 100755 --- a/jenkins_invoke.sh +++ b/jenkins_invoke.sh @@ -2,6 +2,8 @@ set -o nounset ## (set -u) error exit on attempts to deref undefined variable set -o errexit ## (set -e) error exit if subcommand returns nonzero +set -o pipefail ## propagate error exit down pipe +set -o errtrace ## propagate error across time and similar commands SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -13,7 +15,10 @@ export FINDBUGS_HOME=${SCRIPT_DIR}/../findbugs-3.0.1 echo CLASSPATH=${CLASSPATH} echo FINDBUGS_HOME=${FINDBUGS_HOME} -rm cfb.fbp +if [ -e cfb.fbp ]; then + rm cfb.fbp +fi + cat >cfb.fbp < ${WORKSPACE}/bin @@ -21,5 +26,5 @@ cat >cfb.fbp < EOF -cat cfb.fbp +#cat cfb.fbp ./go.sh -c ${SCRIPT_DIR}/config.properties -d cfb -u cfb -p cfb -f cfb.fbp -n jenkins_${JOB_NAME}_${BUILD_NUMBER} -o ${OUT_FILE}