From 5131bfb2f17efba76dd1dbb1c8c57cb138645f02 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sun, 31 Aug 2014 09:14:33 +0000 Subject: [PATCH] jenkins development: enhanced ./jenkins_build status output --- jenkins_build.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins_build.sh b/jenkins_build.sh index 05785f11..42a579ec 100755 --- a/jenkins_build.sh +++ b/jenkins_build.sh @@ -13,11 +13,12 @@ # environment variables (all optional) # JENKINS : URL of jenkins server. Default http://exiv2.dyndns.org:8080 ## -start=$(date) +if [ -z "$JENKINS"]; then export JENKINS=http://exiv2.dyndns.org:8080; fi result=0 base=$(basename $0) tmp=/tmp/$base.tmp -if [ -z "$JENKINS"]; then JENKINS=http://exiv2.dyndns.org:8080; fi +start=$(date) +starts=$(date +%s) ## # functions @@ -48,7 +49,8 @@ if [ "$1" == "status" ]; then declare -A expects=( [linux]=900 [macosx]=900 [cygwin]=1000 [mingw]=100 [msvc]=1200 ) for b in linux macosx cygwin mingw msvc ; do echo $build/$b - curl --silent $JENKINS/job/Exiv2-$build/label=$b/lastBuild/consoleText | tee $tmp | grep -E -e SVN_[A-Z]+= -e JOB_NAME -e BUILD_ID -e Finished $@ ; + curl --silent $JENKINS/job/Exiv2-$build/label=$b/lastBuild/consoleText | tee $tmp |\ + grep -E -e SVN_[A-Z]+= -e JOB_NAME -e BUILD_ID -e Finished -e seconds $@ ; declare -i lines=$(wc -l $tmp | cut -d/ -f 1) declare -i expect=${expects[$b]} diff=$(( lines-expect>0?lines-expect:expect-lines )) @@ -94,7 +96,7 @@ fi echo "1 target = $target platform = $PLATFORM WORKSPACE = $WORKSPACE" if [ $PLATFORM == "macosx" -a -z "$macosx" ]; then export macosx=true ; export target=macosx ; fi if [ $PLATFORM == "linux" -a -z "$linux" ]; then export linux=true ; export target=linux ; fi -if [ -z "$cygwin" -a ! -z $CYGWIN ]; then export cygwin=$CYGWIN ; fi +if [ -z "$cygwin" -a ! -z $CYGWIN ]; then export cygwin=$CYGWIN ; fi if [ -z "$tests" ]; then export tests=true ; fi if [ -z "$WORKSPACE" ]; then export WORKSPACE="$0/$PLATFORM" ; fi @@ -201,8 +203,7 @@ case "$build" in ;; esac -echo start $start -echo finish $(date) +echo target "$target" start: "$start" finish: $(date) diff: $(( $(date +%s) - starts )) seconds set -v # That's all Folks! ##