From c65d744fd8fa49b5eaef200242a08501029fbbcf Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sun, 25 Sep 2016 15:45:39 +0000 Subject: [PATCH] #1230 Buildserver maintenance. --- contrib/buildserver/buildserver.library | 33 ++++++++++++++----------- contrib/buildserver/dailyBuild.sh | 4 +-- contrib/buildserver/dailyCMake.sh | 2 +- contrib/buildserver/dailyTest.sh | 4 +-- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/contrib/buildserver/buildserver.library b/contrib/buildserver/buildserver.library index e06eae95..6cd60c8b 100644 --- a/contrib/buildserver/buildserver.library +++ b/contrib/buildserver/buildserver.library @@ -6,26 +6,28 @@ result=0 if [ -z "$JENKINS" ]; then export JENKINS=http://exiv2.dyndns.org:8080; fi if [ -z "$DAILY" ]; then export DAILY=userContent/builds/Daily ; fi +## +# osName - print 'macosx' or 'cygwin' or 'mingw' or 'linux' +osName () { + if [ $(uname) == Darwin ]; then + echo macosx + elif [ $(uname -o) == Cygwin ]; then + echo cygwin + elif [ $(uname -o) == Msys ]; then + echo mingw + else + echo linux + fi +} + ## # which PLATFORM -# JOB_NAME is defined when script is called by Jenkins -# example: JOB_NAME=trunk-cmake-daily/label=msvc -# PLATFORM must be defined as msvc when called from ssh -if [ ! -z "$JOB_NAME" ];then - PLATFORM=$(echo $JOB_NAME | cut -d= -f 2) -fi +# PLATFORM must be defined as msvc or ming when called from ssh if [ "$PLATFORM" == "" ]; then - export PLATFORM='' - if [ `uname` == Darwin ]; then - PLATFORM=macosx - elif [ `uname -o` == Cygwin ]; then - PLATFORM=cygwin + export PLATFORM=$(echo osName) + if ( "$PLATFORM" == "cygwin" ]; then # tweak path to ensure the correct version of perl and expr for autotools export "PATH=/bin:$PATH" - elif [ `uname -o` == Msys ]; then - PLATFORM=mingw - else - PLATFORM=linux fi fi @@ -41,6 +43,7 @@ thepath () { fi } + # That's all Folks! ## diff --git a/contrib/buildserver/dailyBuild.sh b/contrib/buildserver/dailyBuild.sh index 2eb4d814..ff97795d 100755 --- a/contrib/buildserver/dailyBuild.sh +++ b/contrib/buildserver/dailyBuild.sh @@ -8,8 +8,6 @@ # 2 executes dailyTest.sh to test that the build bundles are good # 3 rebuilds all the links in the userContent/builds for "Category" access to the builds -cd /Users/rmills/gnu/exiv2/buildserver - ssh rmills@rmillsmm 'cd ~/gnu/exiv2/buildserver ; /usr/local/bin/svn update . ; rm -rf build ; contrib/buildserver/dailyCMake.sh' ssh rmills@rmillsmm-kubuntu 'cd ~/gnu/exiv2/buildserver ; /usr/local/bin/svn update . ; rm -rf build ; contrib/buildserver/dailyCMake.sh' ssh rmills@rmillsmm-w7 'cd ~/gnu/exiv2/buildserver ; /usr/local/bin/svn update . ; rm -rf build ; contrib/buildserver/dailyCMake.sh' @@ -19,7 +17,7 @@ ssh rmills@rmillsmm-w7 'cd ~/gnu/exiv2/buildserver ; /usr/local/bin/svn upd ## # test the delivery date=$(date '+%Y-%m-%d+%H-%M-%S') -svn=$(/usr/local/bin/svn info . | grep '^Last Changed Rev' | cut -f 2 -d':' | tr -d ' ') +svn=$(ssh rmills@rmillsmm 'cd ~/gnu/exiv2/buildserver ; /usr/local/bin/svn info . | grep "^Last Changed Rev" | cut -f 2 "-d:" | tr -d " "') output="/mmHD/Users/Shared/Jenkins/Home/userContent/builds/Daily/test-svn-${svn}-date-${date}.txt" echo -------------------------------------- echo test log = $output diff --git a/contrib/buildserver/dailyCMake.sh b/contrib/buildserver/dailyCMake.sh index 0ef53f32..bbef143b 100755 --- a/contrib/buildserver/dailyCMake.sh +++ b/contrib/buildserver/dailyCMake.sh @@ -218,7 +218,7 @@ testBuild() ) | tr -d $'\r' | tee "$build/dist/logs/build.log" # exit if are in mingw and leave cygwin to package the build -if [ $(uname -o) == "Msys" ]; then echo "goodbye from mingw" ; exit 0; fi +if [ $(osName) == "mingw" ]; then echo "goodbye from mingw" ; exit 0; fi ## # store the build for users to collect diff --git a/contrib/buildserver/dailyTest.sh b/contrib/buildserver/dailyTest.sh index e37b2ae2..009a2be2 100755 --- a/contrib/buildserver/dailyTest.sh +++ b/contrib/buildserver/dailyTest.sh @@ -4,10 +4,10 @@ source $(find . -name buildserver.library 2>/dev/null) echo ------------------------------- echo PLATFORM = $PLATFORM PWD = $PWD -if [ $(uname -o) == Msys ]; then +if [ $(osName) == "mingw" ]; then echo "Windows directory (mingw) = " $(pwd -W) fi -if [ $(uname -o) == Cygwin ]; then +if [ $(osName) == "cygwin" ]; then echo "Windows directory (cygwin) = " $(cygpath -aw .) fi echo -------------------------------