Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 2 | #make NAMESPACE directory |
| 3 | mkdir -p /config-init/$NAMESPACE/ |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 4 | |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 5 | #unzip the configs in the NAMESPACEs directory ensuring no overwriting of files |
| 6 | cp -vnpr /opt/config/src/* /config-init/$NAMESPACE/ |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 7 | |
| 8 | #ensure db directories exist. |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 9 | mkdir -p /config-init/$NAMESPACE/appc/data/ |
| 10 | mkdir -p /config-init/$NAMESPACE/dcae/pgaas/pgdata/ |
| 11 | mkdir -p /config-init/$NAMESPACE/portal/mariadb/data/ |
| 12 | mkdir -p /config-init/$NAMESPACE/sdnc/data/ |
| 13 | mkdir -p /config-init/$NAMESPACE/vid/mariadb/data/ |
| 14 | mkdir -p /config-init/$NAMESPACE/sdc/sdc-cs/CS/ |
| 15 | mkdir -p /config-init/$NAMESPACE/sdc/sdc-es/ES/ |
| 16 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-ES/ |
| 17 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-CS/ |
| 18 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-KB/ |
| 19 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-BE/ |
| 20 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-FE/ |
| 21 | mkdir -p /config-init/$NAMESPACE/aai/opt/aai/logroot/ |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 22 | |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 23 | chmod -R 777 /config-init/$NAMESPACE/sdc/logs/ |
| 24 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/ |
| 25 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/ |
| 26 | chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/ |
| 27 | |
| 28 | # replace the default 'onap' namespace qualification of K8s hostnames within the config files |
| 29 | find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/onap-/$NAMESPACE-/g" {} \; |