forked from ChristopherEdwards/PIP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipstart-docker
executable file
·36 lines (31 loc) · 1.11 KB
/
pipstart-docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
trap "/home/pip/pip/pipstop" SIGTERM
cd `dirname $0`
rm -f *.mj[oe]
SCA_ERROR_DIR=$PWD/alerts ; export SCA_ERROR_DIR
ALERT_SCRIPT=$PWD/bin/sca_alert.sh ; export ALERT_SCRIPT
. ./gtmenv
./bin/pipmtm
sleep 5
$gtm_dist/mupip journal -recover -backward gbls/pip.mjl \
&& $gtm_dist/mupip set -journal="enable,on,before" -file gbls/pip.dat \
&& ./dm <<EOF
do JOB^PBSUTL("SCA\$IBS",2)
halt
EOF
find gbls -iname pip.mjl_* -mtime +3 -exec rm -v {} \;
# Start Tomcat
echo "Deploying ProfileBrowserIDE..."
/opt/apache-tomcat-*/bin/catalina.sh start
cp /home/pip/Projects/pip/ProfileBrowserIDE/ProfileBrowserIDE.war /opt/apache-tomcat-*/webapps
sleep 10
# Fix the derby jdbc database location
perl -pi -e 's#jdbc:derby:profile_ide_db#jdbc:derby:/opt/profile_ide_db#g' /opt/apache-tomcat-*/webapps/ProfileBrowserIDE/WEB-INF/applicationContext-acegi-security.xml
/opt/apache-tomcat-*/bin/catalina.sh stop && /opt/apache-tomcat-*/bin/catalina.sh start
echo "Done deploying ProfileBrowserIDE"
# Create a fifo so that bash can read from it to
# catch signals from docker
rm -f ~/fifo
mkfifo ~/fifo || exit
chmod 400 ~/fifo
read < ~/fifo