From 7df7f3b427739ff7d69da2ba218da0124822892c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Sun, 26 Nov 2017 23:39:48 +0000 Subject: Remove all .morph files and files from the old format --- extensions/mason/mason-report.sh | 297 --------------------------------------- 1 file changed, 297 deletions(-) delete mode 100755 extensions/mason/mason-report.sh (limited to 'extensions/mason/mason-report.sh') diff --git a/extensions/mason/mason-report.sh b/extensions/mason/mason-report.sh deleted file mode 100755 index f6cca0ef..00000000 --- a/extensions/mason/mason-report.sh +++ /dev/null @@ -1,297 +0,0 @@ -#!/bin/bash - -set -x - -. /etc/mason.conf - -REPORT_PATH=/var/mason/report.html -SERVER_PATH=/srv/mason -SERVER_REPORT_PATH="$SERVER_PATH/index.html" - -sed_escape() { - printf "%s\n" "$1" | sed -e 's/\W/\\&/g' -} - -create_report() { -cat > $REPORT_PATH <<'EOF' - - - - - - - -

Mason

-

Baserock: Continuous Delivery

-

Build log of changes to BRANCH from TROVE. Most recent first.

- - - - - - - - -
StartedRefDurationResult
- - - -EOF - - sed -i 's/BRANCH/'"$(sed_escape "$1")"'/' $REPORT_PATH - sed -i 's/TROVE/'"$(sed_escape "$2")"'/' $REPORT_PATH -} - -update_report() { - # Give function params sensible names - build_start_time="$1" - build_trove_host="$2" - build_ref="$3" - build_sha1="$4" - build_duration="$5" - build_result="$6" - report_path="$7" - build_log="$8" - - # Generate template if report file is not there - if [ ! -f $REPORT_PATH ]; then - create_report $build_ref $build_trove_host - fi - - # Build table row for insertion into report file - if [ "$build_result" = nonet ]; then - msg=''"${build_start_time}"'Failed to contact '"${build_trove_host}"''"${build_duration}s"''"${build_result}"'' - else - msg=''"${build_start_time}"''"${build_sha1}"''"${build_duration}s"''"${build_result}"'' - fi - - # Insert report line, newest at top - sed -i 's//\n'"$(sed_escape "$msg")"'/' $report_path -} - -update_report_time() { - # Give function params sensible names - build_start_time="$1" - - # If the report file exists, update the last-checked-for-updates time - if [ -f $REPORT_PATH ]; then - sed -i 's/....-..-.. ..:..:..<\/code>/'"$(sed_escape "$build_start_time")"'<\/code>/' $REPORT_PATH - fi -} - -START_TIME=`date +%Y-%m-%d\ %T` - -update_report_time "$START_TIME" -cp "$REPORT_PATH" "$SERVER_PATH/index.html" - -logfile="$(mktemp)" - -#Update current.log symlink to point to the current build log -ln -sf "$logfile" "$SERVER_PATH"/current.log - -#Copy current server report, to restore when result is "skip" -cp "$SERVER_REPORT_PATH" "$SERVER_REPORT_PATH".bak - -update_report "$START_TIME" \ - "$UPSTREAM_TROVE_ADDRESS" \ - "$DEFINITIONS_REF" \ - "" \ - " - " \ - "progress" \ - "$SERVER_REPORT_PATH" \ - "current.log" - - -/usr/lib/mason/mason.sh 2>&1 | tee "$logfile" -case "${PIPESTATUS[0]}" in -0) - RESULT=pass - ;; -33) - RESULT=skip - ;; -42) - RESULT=nonet - ;; -*) - RESULT=fail - ;; -esac - -# TODO: Update page with last executed time -if [ "$RESULT" = skip ]; then - # Restore copied server report, otherwise the 'progress' row will - # be still present with a broken link after we remove the $logfile - mv "$SERVER_REPORT_PATH".bak "$SERVER_REPORT_PATH" - - rm "$logfile" - exit 0 -fi - -DURATION=$(( $(date +%s) - $(date --date="$START_TIME" +%s) )) -SHA1="$(cd "/ws/mason-definitions-$DEFINITIONS_REF" && git rev-parse HEAD)" -BUILD_LOG="log/${SHA1}--${START_TIME}.log" - -update_report "$START_TIME" \ - "$UPSTREAM_TROVE_ADDRESS" \ - "$DEFINITIONS_REF" \ - "$SHA1" \ - "$DURATION" \ - "$RESULT" \ - "$REPORT_PATH" \ - "$BUILD_LOG" - - -# -# Copy report into server directory -# - -cp "$REPORT_PATH" "$SERVER_REPORT_PATH" -mkdir "$SERVER_PATH/log" -mv "$logfile" "$SERVER_PATH/$BUILD_LOG" - -# Cleanup - -mkdir -p /srv/distbuild/remove -find /srv/distbuild/ -not \( -name "remove" -o -name "trees.cache.pickle" \) -mindepth 1 -maxdepth 1 -exec mv '{}' /srv/distbuild/remove \; -find /srv/distbuild/remove -delete -- cgit v1.2.1