Skip to content

Commit

Permalink
minor modifications:
Browse files Browse the repository at this point in the history
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
Jess Portnoy committed Mar 3, 2014
1 parent 17e2c71 commit 9454214
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
6 changes: 5 additions & 1 deletion RPM/SPECS/kaltura-postinst.spec
Expand Up @@ -3,7 +3,7 @@
Summary: Kaltura Open Source Video Platform Summary: Kaltura Open Source Video Platform
Name: kaltura-postinst Name: kaltura-postinst
Version: 1.0.7 Version: 1.0.7
Release: 18 Release: 19
License: AGPLv3+ License: AGPLv3+
Group: Server/Platform Group: Server/Platform
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Expand Down Expand Up @@ -76,6 +76,10 @@ fi
%config %{prefix}/app/configurations/* %config %{prefix}/app/configurations/*


%changelog %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 * 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 - Fix for https://github.com/kaltura/platform-install-packages/issues/47


Expand Down
20 changes: 11 additions & 9 deletions RPM/scripts/postinst/kaltura-db-update.sh
Expand Up @@ -18,25 +18,27 @@ RC=0


if [ -r "/opt/kaltura/app/configurations/system.ini" -a -r /opt/kaltura/app/deployment/sql_updates ];then if [ -r "/opt/kaltura/app/configurations/system.ini" -a -r /opt/kaltura/app/deployment/sql_updates ];then
. /opt/kaltura/app/configurations/system.ini . /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 # 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. # 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 [ -r $APP_DIR/deployment/sql_updates.done ];then
if grep -q $SQL /opt/kaltura/app/deployment/sql_updates.done;then if grep -q $SQL $APP_DIR/deployment/sql_updates.done;then
continue continue
fi fi
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=$? RC=$?
done done
if [ $RC -eq 0 ];then if [ $RC -eq 0 ];then
cat /opt/kaltura/app/deployment/sql_updates >> /opt/kaltura/app/deployment/sql_updates.done cat $APP_DIR/deployment/sql_updates >> $APP_DIR/deployment/sql_updates.done
rm /opt/kaltura/app/deployment/sql_updates rm $APP_DIR/deployment/sql_updates
fi fi
fi fi


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

0 comments on commit 9454214

Please sign in to comment.