-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathentry.sh
41 lines (39 loc) · 1.4 KB
/
entry.sh
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
37
38
39
40
41
#!/bin/bash
# trap SIGTERM and gracefully stops alfresco
trap '/opt/alfresco/alfresco.sh stop;exit 0' SIGTERM
set -e
if [ ! -f /opt/alfresco/alf_data/foo.txt ]; then
cp -Rp /opt/alfresco/alf_data_back/* /opt/alfresco/alf_data;
bash /install.sh;
bash /tunerepo.sh;
bash /modifinitpass.sh;
# /opt/alfresco/alfresco.sh start;
# /waitready.sh;
# /opt/alfresco/alfresco.sh stop;
if [ -z ${CONTAINER_FUNCTION+x} ]; then
echo "Tomcat and Postgres running in same container";
else
echo "Creating DB from alfresco contaner";
export PGPASSWORD=mysecretpassword;/opt/alfresco/postgresql/bin/psql -h "$DB_CONTAINER_NAME" -p "5432" -U postgres < /create.sql
fi
echo "After fi1";
bash /tunesolr.sh;
echo "After fi2";
touch /opt/alfresco/alf_data/foo.txt;
echo "After fi3"
fi
echo "After fi4";
# setting values for all the "-e ALF_xxx=..." parameters provided at startup
bash /tuneglobal.sh
echo "After fi5";
# start postgres and alfresco separately
if [ -z ${CONTAINER_FUNCTION+x} ]; then
echo "Tomcat and Postgres running in same container";
/opt/alfresco/alfresco.sh start;
else
echo "Running only $CONTAINER_FUNCTION";
/opt/alfresco/alfresco.sh start $CONTAINER_FUNCTION;
fi
echo "After fi6";
# dumping logs to stdout
tail -F /opt/alfresco/alfresco.log -F /opt/alfresco/share.log -F /opt/alfresco/solr.log