Commit 6148dbd9 authored by Cédric BRINER's avatar Cédric BRINER Committed by Cédric BRINER
Browse files

added rewar

parent 4db65a49
......@@ -76,6 +76,7 @@ function has_ssh_agent
fi
}
# GIT STUFF
function get_git_for_sync_header
{
......@@ -110,6 +111,8 @@ function get_git_hash
git -C ${IDP_HOME} log --pretty=format:'%H' | head -1
}
# # # # # # # #
function create_tmp_idp_sed
{
grep -E 'ndb.*idp|arbitrator.*idp' /etc/hosts \
......@@ -211,6 +214,7 @@ function status_old()
done
}
# MYSQL STUFF
function get_mysql_pw
{
......@@ -384,14 +388,6 @@ function load_mysql()
echo "✔ shibboleth systems is up"
}
#############################################################$$
##############################################################
##############################################################
......@@ -722,6 +718,20 @@ function construct_sync_header
}
function rewar
{
pb "- rebuild the war itself"
JAVACMD=/usr/bin/java /opt/shibboleth-idp/bin/build.sh -Didp.target.dir=/opt/shibboleth-idp | indent 4
pb "- stop service"
systemctl stop tomcat7.service | indent 4
pb "- delete old war"
rm -fr /var/lib/tomcat7/webapps/idp | indent 4
pb "- start service"
systemctl start tomcat7.service | indent 4
}
function sync
{
#
......@@ -1338,14 +1348,7 @@ EOF
echo -e " \e[34m- rebuild war (rebuild the war, stop tomcat, remove old war, start tomcat)\e[0m"
if test ${RESTART_DAEMON} = "True"
then
echo -e " \e[34m- rebuild the war itself\e[0m"
ssh root@${h} "JAVACMD=/usr/bin/java /opt/shibboleth-idp/bin/build.sh -Didp.target.dir=/opt/shibboleth-idp" | indent 7
echo -e " \e[34m- stop service\e[0m"
ssh root@${h} "systemctl stop tomcat7.service" | indent 7
echo -e " \e[34m- delete old war\e[0m"
ssh root@${h} "rm -fr /var/lib/tomcat7/webapps/idp" | indent 7
echo -e " \e[34m- start service\e[0m"
ssh root@${h} "systemctl start tomcat7.service" | indent 7
ssh root@${h} idp-tools rewar | indent 3
else
echo -e " \e[34mwar will no be re-consructed as this imply a restart of tomcat7\e[0m"
echo -e " \e[34mand as the flag (RESTART_DAEMON) is set false\e[0m"
......@@ -1920,6 +1923,7 @@ function usage_n_exit
pb " | shell-mysql"
pb " | sync [--no-restart] <to_host>"
pb " | tungsten-watch-sync <other_host>"
pb " | rewar"
pb " | reload <pattern_beans> [host,[...]]"
pb " | aacli [-h | -l [<entityId>] | [-r] <user> <entityId>]"
pb " | "
......@@ -1927,6 +1931,7 @@ function usage_n_exit
pb ""
pb "Info:"
pb " adjust : adjust chown and mode on some files"
pb " rewar : stop tomcat, rebuild war, delete deployed war, star tomcat"
pb " tungsten-status : gives the tungsten status to see if stuff are synchronized"
pb " dump-mysql : dump myqsl"
pb " load-mysql : load mysql"
......@@ -2006,6 +2011,9 @@ case "$1" in
has_ssh_agent
tungsten_watch_sync $2
;;
rewar)
rewar
;;
reload)
shift
if test $# = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment