From 8893bb730b7d4127f1e4f8a47146d5dfb9300c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Sat, 17 Oct 2015 22:06:18 +0200 Subject: Implemented init script for the SAML daemon, modified the refresh-and-deploy script accordingly. --- scripts/deploy/codeq_refresh_and_deploy.sh | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'scripts/deploy') diff --git a/scripts/deploy/codeq_refresh_and_deploy.sh b/scripts/deploy/codeq_refresh_and_deploy.sh index e44739b..966737b 100755 --- a/scripts/deploy/codeq_refresh_and_deploy.sh +++ b/scripts/deploy/codeq_refresh_and_deploy.sh @@ -8,6 +8,7 @@ export CODEQ_PROBLEMS CODEQ_WEB_OUTPUT CODEQ_DB_HOST CODEQ_DB_DATABASE CODEQ_DB_ RESTART_PROLOG=0 RESTART_SERVER=0 RESTART_WEB=0 +RESTART_SAML=0 BUILD_WEB_RESOURCES=0 init=$(cat /proc/1/comm) @@ -24,7 +25,7 @@ if git diff --name-status origin/$CODEQ_GIT_BRANCH | cut -c3- | grep -v \\.gitig RESTART_PROLOG=1 fi - if grep -q -v '^\(web\|prolog/runner\|scripts\)/' $FILES; then + if grep -qv '^\(web\|saml\|prolog/runner\|scripts\)/' $FILES; then RESTART_SERVER=1 fi @@ -32,6 +33,10 @@ if git diff --name-status origin/$CODEQ_GIT_BRANCH | cut -c3- | grep -v \\.gitig RESTART_WEB=1 fi + if grep -q ^saml/ $FILES; then + RESTART_SAML=1 + fi + if grep -q ^scripts/build_web_resources.py $FILES; then BUILD_WEB_RESOURCES=1 fi @@ -43,9 +48,14 @@ if git diff --name-status origin/$CODEQ_GIT_BRANCH | cut -c3- | grep -v \\.gitig fi done - if grep -q ^web/ $FILES | grep -v ^web/main.js; then + if grep ^web/ $FILES | grep -qv ^web/main.js; then + # node dependencies may have changed, run installation + cd $CODEQ_SERVER/web && /usr/bin/npm install + fi + + if grep ^saml/ $FILES | grep -qv ^saml/saml.js; then # node dependencies may have changed, run installation - cd web && /usr/bin/npm install + cd $CODEQ_SERVER/saml && /usr/bin/npm install fi fi @@ -102,5 +112,18 @@ if [ $RESTART_WEB -ne 0 ]; then /etc/init.d/codeq-web restart fi fi +if [ $RESTART_SAML -ne 0 ]; then + if [ "$init" = systemd ]; then + if systemctl list-unit-files codeq-saml.service|grep -q codeq-saml.service; then + echo Restarting codeq-saml + systemctl restart codeq-saml + fi + else + if [ -x /etc/init.d/codeq-saml ]; then + echo Restarting codeq-saml + /etc/init.d/codeq-saml restart + fi + fi +fi exit 0 -- cgit v1.2.1