Pamela Dragosh | d1728dc | 2017-02-14 19:57:17 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # skip installation if build.info file is present (restarting an existing container) |
| 4 | if [[ -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 |
| 7 | else |
| 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 | |
Pamela Dragosh | d1728dc | 2017-02-14 19:57:17 -0500 | [diff] [blame] | 26 | if [[ -x config/drools-tweaks.sh ]] ; then |
| 27 | echo "Executing tweaks" |
| 28 | # file may not be executable; running it as an |
| 29 | # argument to bash avoids needing execute perms. |
| 30 | bash config/drools-tweaks.sh |
| 31 | fi |
| 32 | |
| 33 | # wait for DB up |
| 34 | ./wait-for-port.sh mariadb 3306 |
Jorge Hernandez | 3700dbd | 2017-09-26 14:57:27 -0500 | [diff] [blame] | 35 | |
Jorge Hernandez | 3ffb016 | 2017-06-05 10:19:09 -0500 | [diff] [blame] | 36 | # now that DB is up, invoke database upgrade: |
| 37 | # sql provisioning scripts should be invoked here. |
Pamela Dragosh | d1728dc | 2017-02-14 19:57:17 -0500 | [diff] [blame] | 38 | fi |
| 39 | |
| 40 | echo "Starting processes" |
| 41 | |
Jorge Hernandez | 0c07ac4 | 2017-08-28 18:25:23 -0500 | [diff] [blame] | 42 | policy start |
Pamela Dragosh | d1728dc | 2017-02-14 19:57:17 -0500 | [diff] [blame] | 43 | |
| 44 | sleep 1000d |