diff options
-rw-r--r-- | production/dirtReport.sh | 26 | ||||
-rw-r--r-- | production/master-build.sh | 6 |
2 files changed, 32 insertions, 0 deletions
diff --git a/production/dirtReport.sh b/production/dirtReport.sh new file mode 100644 index 000000000..5dff309d2 --- /dev/null +++ b/production/dirtReport.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Utility to log "dirt report" +# The required variables are expected to be in "env_file", +# but of all those, +# we need +# aggDir: top of working tree (absolute patch to aggregation module directory) +# BUILD_ID: needed to "pretty print" to top of report. +# output goes to "std out", and assume it is captured by calling program, as desired. + +if [ $# -ne 1 ]; then + echo USAGE: $0 env_file + exit 1 +fi + +if [ ! -r "$1" ]; then + echo "$1" cannot be read + echo USAGE: $0 env_file + exit 1 +fi + +source "$1" + +printf "\n\t%s\n\n" "Dirt Report for $BUILD_ID" +git -C "$aggDir" status +git -C "$aggDir" submodule foreach git status diff --git a/production/master-build.sh b/production/master-build.sh index b3c5fc1f4..6644aaaa8 100644 --- a/production/master-build.sh +++ b/production/master-build.sh @@ -167,6 +167,7 @@ fn-write-property INITIAL_ENV_FILE fn-write-property BUILD_ROOT fn-write-property BRANCH fn-write-property STREAM +fn-write-property aggDir fn-write-property BUILD_ID fn-write-property BUILD_TYPE fn-write-property TIMESTAMP @@ -359,6 +360,11 @@ fi $SCRIPT_PATH/promote-build.sh $BUILD_ENV_FILE 2>&1 | tee $logsDirectory/mb090_promote-build_output.txt checkForErrorExit $? "Error occurred during promote-build" +# check for dirt in working tree. Note. we want near very end, since even things +# like "publishing" in theory could leave dirt behind. +$SCRIPT_PATH/dirtReport.sh $BUILD_ENV_FILE >$logsDirectory/dirtReport.txt +checkForErrorExit $? "Error occurred during dirt report" + fn-write-property-close # dump ALL environment variables in case its helpful in documenting or |