IDEMPIERE-3655 Improve installer to include migration scripts and syncApplied / safe error message when folder does not exist

This commit is contained in:
Carlos Ruiz 2018-11-19 12:39:07 -02:00
parent 620b9715bb
commit 63472d7ca9
2 changed files with 16 additions and 3 deletions

View File

@ -44,6 +44,11 @@ else
fi fi
cd "$DIR_SCRIPTS" cd "$DIR_SCRIPTS"
if [ $? -ne 0 ]
then
echo "ERROR: Cannot change to folder $DIR_SCRIPTS"
exit 1
fi
# Create list of files already applied - registered in AD_MigrationScript table # Create list of files already applied - registered in AD_MigrationScript table
echo "set heading off echo "set heading off
@ -109,4 +114,6 @@ if [ -n "$MSGERROR" ]
then then
echo "$MSGERROR" echo "$MSGERROR"
echo "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again" echo "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again"
exit 1
fi fi
exit 0

View File

@ -46,6 +46,11 @@ else
fi fi
cd "$DIR_SCRIPTS" cd "$DIR_SCRIPTS"
if [ $? -ne 0 ]
then
echo "ERROR: Cannot change to folder $DIR_SCRIPTS"
exit 1
fi
# Create list of files already applied - registered in AD_MigrationScript table # Create list of files already applied - registered in AD_MigrationScript table
echo "select name from ad_migrationscript" | $SILENTCMD | sed -e 's:^ ::' | grep -v '^$' | sort > $TMPFOLDER/lisDB_$$.txt echo "select name from ad_migrationscript" | $SILENTCMD | sed -e 's:^ ::' | grep -v '^$' | sort > $TMPFOLDER/lisDB_$$.txt
@ -102,11 +107,12 @@ then
fi fi
done done
fi fi
PGPASSWORD=
export PGPASSWORD
if [ -n "$MSGERROR" ] if [ -n "$MSGERROR" ]
then then
echo "$MSGERROR" echo "$MSGERROR"
echo "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again" echo "\n Errors were found during the process (see message above) - please review and fix the error running manually the script - and then restart this process again"
exit 1
fi fi
exit 0
PGPASSWORD=
export PGPASSWORD