Merge "Updated Cloud Guide with links to wiki"
[oom.git] / kubernetes / policy / charts / drools / resources / scripts / do-start.sh
1 # Copyright © 2017 Amdocs, Bell Canada, AT&T
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 #!/bin/bash
16
17 # skip installation if build.info file is present (restarting an existing container)
18 if [[ -f /opt/app/policy/etc/build.info ]]; then
19         echo "Found existing installation, will not reinstall"
20         . /opt/app/policy/etc/profile.d/env.sh
21 else 
22         # replace conf files from installer with environment-specific files
23         # mounted from the hosting VM
24         if [[ -d config ]]; then
25                 cp config/*.conf .
26         fi
27
28         ./docker-install.sh
29
30         . /opt/app/policy/etc/profile.d/env.sh
31
32         # install policy keystore
33         mkdir -p $POLICY_HOME/etc/ssl
34         cp config/policy-keystore $POLICY_HOME/etc/ssl
35
36         if [[ -x config/drools-tweaks.sh ]] ; then
37                 echo "Executing tweaks"
38                 # file may not be executable; running it as an
39                 # argument to bash avoids needing execute perms.
40                 bash config/drools-tweaks.sh
41         fi
42
43         # sql provisioning scripts should be invoked here.
44 fi
45
46 echo "Starting processes"
47
48 policy start
49
50 sleep 1000d