summaryrefslogtreecommitdiff
path: root/scripts/deploy
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-10-17 22:06:18 +0200
committerAleš Smodiš <aless@guru.si>2015-10-17 22:06:18 +0200
commit8893bb730b7d4127f1e4f8a47146d5dfb9300c81 (patch)
tree8caec96890db6348ac932641e1b25320ddfa9615 /scripts/deploy
parent79c4800ac99c24400ad9da91101b48d6a55234b9 (diff)
Implemented init script for the SAML daemon, modified the refresh-and-deploy script accordingly.
Diffstat (limited to 'scripts/deploy')
-rwxr-xr-xscripts/deploy/codeq_refresh_and_deploy.sh29
1 files changed, 26 insertions, 3 deletions
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