Permalink
Browse files

minor modifications:

0. once system.ini is sources used APP_DIR ENV var
1. Populate the OUT var with the STD{ERR,OUT} of the MySQL command and output in the event of failure.
  • Loading branch information...
jessp01 committed Mar 3, 2014
1 parent 17e2c71 commit 94542147a10f93b047f3fefc2b59e9656cb7c9e5
Showing with 21 additions and 12 deletions.
  1. +5 −1 RPM/SPECS/kaltura-postinst.spec
  2. +11 −9 RPM/scripts/postinst/kaltura-db-update.sh
  3. +5 −2 sanity_tests/utils.rc
@@ -3,7 +3,7 @@
Summary: Kaltura Open Source Video Platform
Name: kaltura-postinst
Version: 1.0.7
Release: 18
Release: 19
License: AGPLv3+
Group: Server/Platform
Source0: %{name}-%{version}.tar.gz
@@ -76,6 +76,10 @@ fi
%config %{prefix}/app/configurations/*

%changelog
* Sat Mar 1 2014 Jess Portnoy <jess.portnoy@kaltura.com> - 1.0.7-19
- Write {KEY,CRT}_FILE to system.ini
- Fix consent code flow to work with ans file.

* Fri Feb 27 2014 Jess Portnoy <jess.portnoy@kaltura.com> - 1.0.7-15
- Fix for https://github.com/kaltura/platform-install-packages/issues/47

@@ -18,25 +18,27 @@ RC=0

if [ -r "/opt/kaltura/app/configurations/system.ini" -a -r /opt/kaltura/app/deployment/sql_updates ];then
. /opt/kaltura/app/configurations/system.ini
for SQL in `cat /opt/kaltura/app/deployment/sql_updates`;do
for SQL in `cat $APP_DIR/deployment/sql_updates`;do
# if we have the .done file, then some updates already happened
# need to check if our current one is in the done list, if so, skip it.
if [ -r /opt/kaltura/app/deployment/sql_updates.done ];then
if grep -q $SQL /opt/kaltura/app/deployment/sql_updates.done;then
if [ -r $APP_DIR/deployment/sql_updates.done ];then
if grep -q $SQL $APP_DIR/deployment/sql_updates.done;then
continue
fi
fi
mysql kaltura -h $DB1_HOST -u $SUPER_USER -P $DB1_PORT -p$SUPER_USER_PASSWD < $SQL
OUT="$OUT || `mysql kaltura -h $DB1_HOST -u $SUPER_USER -P $DB1_PORT -p$SUPER_USER_PASSWD < $SQL 2>&1`"
RC=$?
done
if [ $RC -eq 0 ];then
cat /opt/kaltura/app/deployment/sql_updates >> /opt/kaltura/app/deployment/sql_updates.done
rm /opt/kaltura/app/deployment/sql_updates
cat $APP_DIR/deployment/sql_updates >> $APP_DIR/deployment/sql_updates.done
rm $APP_DIR/deployment/sql_updates
fi
fi

if [ -f /opt/kaltura/app/deployment/sql_updates ];then
echo "error occurred during DB update"
if [ -f $APP_DIR/deployment/sql_updates ];then
echo "Error occurred during DB update:
$OUT
"
else
echo "${RC} manual DB updates done"
echo "Manual DB updates finished with RC $RC"
fi
@@ -1,3 +1,6 @@
MON_PARTNER=-4
MON_PARTNER_SECRET=
MON_PARTNER=""
MON_PARTNER_SECRET=""
ADMIN_PARTNER="-2"
ADMIN_PARTNER_SECRET=""
SERVICEURL=""
export MON_PARTNER MON_PARTNER_SECRET

0 comments on commit 9454214

Please sign in to comment.