From b938ef60917f1e3d5202ef1de1c8fe035fef9178 Mon Sep 17 00:00:00 2001 From: Pavol Zibrita Date: Mon, 10 Oct 2011 22:09:02 +0200 Subject: [PATCH] better build status response from scripts --- build-scripts/build_branches.sh | 19 +++++++++++++++++-- build-scripts/daily_build.sh | 16 +++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/build-scripts/build_branches.sh b/build-scripts/build_branches.sh index 4b09d077d8..1f03d23d69 100755 --- a/build-scripts/build_branches.sh +++ b/build-scripts/build_branches.sh @@ -58,13 +58,28 @@ do if [ ! -d assets ]; then mkdir assets fi - ant clean debug + ant clean debug &> $DIRECTORY/build.log if [ "$BRANCH" = "release" ]; then cp bin/OsmAnd-debug.apk "$LATESTS_DIR/OsmAnd-stable.apk" elif [ "$BRANCH" = "master" ]; then cp bin/OsmAnd-debug.apk "$LATESTS_DIR/OsmAnd-development.apk" fi - mv bin/OsmAnd-debug.apk "$BUILD_DIR/OsmAnd-$BRANCH-nb-$DATE.apk" + mv bin/OsmAnd-debug.apk "$BUILD_DIR/OsmAnd-$BRANCH-nb-$DATE.apk" + + #clear success status + rm -f $DIRECTORY/$BRANCH.fixed + #put the log to std out + cat $DIRECTORY/build.log + BUILD=`grep FAILED $DIRECTORY/build.log | wc -l` + if [ ! $BUILD -eq 0 ]; then + touch $DIRECTORY/$BRANCH.failed + else + if [ -f $DIRECTORY/$BRANCH.failed ]; then + echo "Build fixed" + rm $DIRECTORY/$BRANCH.failed + touch $DIRECTORY/$BRANCH.fixed + fi + fi fi fi done diff --git a/build-scripts/daily_build.sh b/build-scripts/daily_build.sh index 16769a8da9..2d4d65ab59 100755 --- a/build-scripts/daily_build.sh +++ b/build-scripts/daily_build.sh @@ -32,16 +32,14 @@ touch $CLOG_FILE "${DIRECTORY}/update_site.sh" >>$LOG_FILE 2>&1 cat $LOG_FILE >> $CLOG_FILE -BUILD=`grep FAILED $LOG_FILE | wc -l` +BUILD=`ls *.fixed *.failed 2> /dev/null | wc -l` if [ ! $BUILD -eq 0 ]; then - # if some failure, print out complete log - echo "BUILD FAILED:" + # if some status change, print out complete log + echo "Builds status changed" + echo "-------------" + echo `ls *.fixed *.failed` + echo "-------------" + echo "Complete log file:" echo "-------------" cat $LOG_FILE - touch last_build_failed -else - if [ -f last_build_failed ]; then - echo "Build fixed" - rm last_build_failed - fi fi