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/ |
Mandeep Khinda | 82c63d3 | 2017-08-21 16:04:37 -0400 | [diff] [blame] | 12 | mkdir -p /config-init/$NAMESPACE/portal/logs/ |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 13 | mkdir -p /config-init/$NAMESPACE/sdnc/data/ |
| 14 | mkdir -p /config-init/$NAMESPACE/vid/mariadb/data/ |
| 15 | mkdir -p /config-init/$NAMESPACE/sdc/sdc-cs/CS/ |
| 16 | mkdir -p /config-init/$NAMESPACE/sdc/sdc-es/ES/ |
| 17 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-ES/ |
| 18 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-CS/ |
| 19 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-KB/ |
| 20 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-BE/ |
| 21 | mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-FE/ |
| 22 | mkdir -p /config-init/$NAMESPACE/aai/opt/aai/logroot/ |
Mandeep Khinda | 9cd2211 | 2017-08-30 14:40:13 +0000 | [diff] [blame] | 23 | mkdir -p /config-init/$NAMESPACE/aai/model-loader/logs/ |
| 24 | mkdir -p /config-init/$NAMESPACE/aai/haproxy/log/ |
Mandeep Khinda | 76092d6 | 2017-09-01 02:15:17 +0000 | [diff] [blame] | 25 | mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/ |
| 26 | mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/ |
Mandeep Khinda | 9cd2211 | 2017-08-30 14:40:13 +0000 | [diff] [blame] | 27 | mkdir -p /config-init/$NAMESPACE/aai/sparky-be/logs/ |
| 28 | mkdir -p /config-init/$NAMESPACE/aai/elasticsearch/es-data/ |
Mandeep Khinda | 76092d6 | 2017-09-01 02:15:17 +0000 | [diff] [blame] | 29 | mkdir -p /config-init/$NAMESPACE/aai/search-data-service/logs/ |
| 30 | mkdir -p /config-init/$NAMESPACE/aai/data-router/logs/ |
BorislavG | 66a9a5c | 2017-09-06 15:12:46 +0300 | [diff] [blame^] | 31 | mkdir -p /config-init/$NAMESPACE/mso/mariadb/data |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 32 | |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 33 | chmod -R 777 /config-init/$NAMESPACE/sdc/logs/ |
Mandeep Khinda | 82c63d3 | 2017-08-21 16:04:37 -0400 | [diff] [blame] | 34 | chmod -R 777 /config-init/$NAMESPACE/portal/logs/ |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 35 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/ |
| 36 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/ |
| 37 | chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/ |
Mandeep Khinda | 9cd2211 | 2017-08-30 14:40:13 +0000 | [diff] [blame] | 38 | chmod -R 777 /config-init/$NAMESPACE/aai/model-loader/logs/ |
| 39 | chmod -R 777 /config-init/$NAMESPACE/aai/haproxy/log/ |
| 40 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-traversal/logs/ |
| 41 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-resources/logs/ |
| 42 | chmod -R 777 /config-init/$NAMESPACE/aai/sparky-be/logs/ |
| 43 | chmod -R 777 /config-init/$NAMESPACE/aai/elasticsearch/es-data/ |
Mandeep Khinda | 76092d6 | 2017-09-01 02:15:17 +0000 | [diff] [blame] | 44 | chmod -R 777 /config-init/$NAMESPACE/aai/search-data-service/logs/ |
| 45 | chmod -R 777 /config-init/$NAMESPACE/aai/data-router/logs/ |
BorislavG | 66a9a5c | 2017-09-06 15:12:46 +0300 | [diff] [blame^] | 46 | chmod -R 777 /config-init/$NAMESPACE/policy/mariadb/ |
Mandeep Khinda | 76092d6 | 2017-09-01 02:15:17 +0000 | [diff] [blame] | 47 | |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 48 | |
| 49 | # replace the default 'onap' namespace qualification of K8s hostnames within the config files |
Mandeep Khinda | 9cd2211 | 2017-08-30 14:40:13 +0000 | [diff] [blame] | 50 | find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/\.onap-/\.$NAMESPACE-/g" {} \; |