blob: 0d57d83420d3019716093cc139cd0869d872a03b [file] [log] [blame]
Pamela Dragoshd1728dc2017-02-14 19:57:17 -05001#!/bin/bash
2
3# skip installation if build.info file is present (restarting an existing container)
4if [[ -f /opt/app/policy/etc/build.info ]]; then
5 echo "Found existing installation, will not reinstall"
6 . /opt/app/policy/etc/profile.d/env.sh
7else
8 # replace conf files from installer with environment-specific files
9 # mounted from the hosting VM
10 if [[ -d config ]]; then
11 cp config/*.conf .
12 fi
13
14 # wait for nexus up before installing, since installation
15 # needs to deploy some artifacts to the repo
16 ./wait-for-port.sh nexus 8081
17
18 ./docker-install.sh
19
20 . /opt/app/policy/etc/profile.d/env.sh
21
22 # install policy keystore
23 mkdir -p $POLICY_HOME/etc/ssl
24 cp config/policy-keystore $POLICY_HOME/etc/ssl
25
26 # this should probably be done by install.sh
27 mvn install:install-file archetype:crawl -Dfile="archetype-closedloop-demo-rules-1.0.0-SNAPSHOT.jar" -DgroupId=org.openecomp.policy.archetype -DartifactId=archetype-closedloop-demo-rules -Dversion="1.0.0-SNAPSHOT" -Dpackaging=jar -DgeneratePom=true -DupdateReleaseInfo=true
28
29 if [[ -x config/drools-tweaks.sh ]] ; then
30 echo "Executing tweaks"
31 # file may not be executable; running it as an
32 # argument to bash avoids needing execute perms.
33 bash config/drools-tweaks.sh
34 fi
35
36 # wait for DB up
37 ./wait-for-port.sh mariadb 3306
38 # now that DB is up, invoke database upgrade
39 # (which does nothing if the db is already up-to-date)
40 dbuser=$(echo $(grep '^JDBC_USER=' base.conf | cut -f2 -d=))
41 dbpw=$(echo $(grep '^JDBC_PASSWORD=' base.conf | cut -f2 -d=))
42 db_upgrade_droolspdp_remote.sh $dbuser $dbpw mariadb
43fi
44
45echo "Starting processes"
46
47policy.sh start
48
49sleep 1000d