1 # Copyright © 2017 Amdocs, Bell Canada, AT&T
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Script to configure and start the Policy components that are to run in the designated container,
18 # It is intended to be used as the entrypoint in the Dockerfile, so the last statement of the
19 # script just goes into a long sleep so that the script does not exit (which would cause the
20 # container to be torn down).
26 comps="base pap paplp console mysql elk"
29 comps="base pdp pdplp"
35 echo "Usage: do-start.sh pap|pdp|brmsgw" >&2
40 # skip installation if build.info file is present (restarting an existing container)
41 if [[ -f /opt/app/policy/etc/build.info ]]; then
42 echo "Found existing installation, will not reinstall"
43 . /opt/app/policy/etc/profile.d/env.sh
46 if [[ -d config ]]; then
50 for comp in $comps; do
51 echo "Installing component: $comp"
52 ./docker-install.sh --install $comp
54 for comp in $comps; do
55 echo "Configuring component: $comp"
56 ./docker-install.sh --configure $comp
59 . /opt/app/policy/etc/profile.d/env.sh
62 #changed to use http instead of http, so keystore no longer needed
63 #cp config/policy-keystore.jks $POLICY_HOME/etc/ssl/policy-keystore
65 if [[ -f config/$container-tweaks.sh ]] ; then
66 # file may not be executable; running it as an
67 # argument to bash avoids needing execute perms.
68 bash config/$container-tweaks.sh
71 if [[ $container == pap ]]; then
73 # now that DB is up, invoke database upgrade
74 # (which does nothing if the db is already up-to-date)
75 dbuser=$(echo $(grep '^JDBC_USER=' base.conf | cut -f2 -d=))
76 dbpw=$(echo $(grep '^JDBC_PASSWORD=' base.conf | cut -f2 -d=))
77 db_upgrade_remote.sh $dbuser $dbpw {{.Values.global.mariadb.nameOverride}}
84 # on pap, wait for pap, pdp, brmsgw, nexus and drools up,
85 # then push the initial default policies
86 if [[ $container == pap ]]; then
87 # wait addional 1 minute for all processes to get fully initialized and synched up
89 bash -xv config/push-policies.sh