Skip to content
Permalink
Browse files
Merge pull request #27 from Whoever57/develop
Log build failures and provide summary at end of run
  • Loading branch information
myrle-krantz committed Oct 20, 2017
2 parents e54354c + 58fa4d1 commit b65f84db626bba5848639c3599f159dbdfc7c546
Showing 1 changed file with 45 additions and 7 deletions.
@@ -1,20 +1,28 @@
#!/bin/bash
githubAccount=$1

exec 5>&1
# REM create core folder
mkdir -p core
cd core

ERRORS=""
FAILEDMODULES=""
get_modules() {
for module in $@
do
git clone https://github.com/$githubAccount/$module.git
cd $module
pushd $module
git remote add upstream https://github.com/mifosio/$module.git
# For some reason permission is denied
chmod +x gradlew
./gradlew publishToMavenLocal
cd ..
THISBUILD="\nBUILDING $module\n"
THISBUILD+=$(./gradlew publishToMavenLocal |& tee >(cat - >&5)
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi )
if [ $? -ne 0 ]; then
ERRORS+="$(echo -e $THISBUILD | tail)\n"
FAILEDMODULES+="$module "
fi
popd
done
}

@@ -30,7 +38,13 @@ cd tools
# REM initialize javamoney
git clone https://github.com/JavaMoney/javamoney-lib.git
cd javamoney-lib
mvn install -Dmaven.test.skip=true
THISBUILD="\nBUILDING javamoney-lib\n"
THISBUILD+=$(mvn install -Dmaven.test.skip=true |& tee >(cat - >&5)
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi )
if [ $? -ne 0 ]; then
ERRORS+="$( echo -e $THISBUILD | tail)\n"
FAILEDMODULES+="javamoney-lib "
fi

cd ..

@@ -39,7 +53,14 @@ git clone https://github.com/$githubAccount/crypto.git
cd crypto
git remote add upstream https://github.com/mifosio/crypto.git
chmod +x gradlew
./gradlew publishToMavenLocal
THISBUILD="\nBUILDING crypto\n"
THISBUILD+=$(./gradlew publishToMavenLocal |& tee >(cat - >&5)
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi )
if [ $? -ne 0 ]; then
ERRORS+="$(echo -e $THISBUILD | tail) \n"
FAILEDMODULES+="crypto "
fi

cd ..

# exit tools directory
@@ -68,7 +89,13 @@ git clone https://github.com/$githubAccount/test-accounting-portfolio.git
cd test-accounting-portfolio
git remote add upstream https://github.com/mifosio/test-accounting-portfolio.git
chmod +x gradlew
./gradlew build
THISBUILD="\nBUILDING test-accounting-portfolio\n"
THISBUILD+=$( ./gradlew build |& tee >(cat - >&5)
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi )
if [ $? -ne 0 ]; then
ERRORS+="$(echo -e $THISBUILD | tail)\n"
FAILEDMODULES+="test-accounting-portfolio "
fi
# exit integration-tests directory
cd ..

@@ -79,3 +106,14 @@ git remote add upstream https://github.com/mifosio/fims-web-app.git
npm i

cd ..

if [ ! -z "$ERRORS" ] ; then
echo "********************"
echo "Build errors found:"
echo "********************"
echo -e "$ERRORS"
echo "********************"
echo "Build errors found"
echo "********************"
echo "The following modules failed to build: $FAILEDMODULES"
fi

0 comments on commit b65f84d

Please sign in to comment.