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/ |
| 25 | mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/ajsc-jetty/gc/ |
| 26 | mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/dmaapAAIEventConsumer/ |
| 27 | mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/perf-audit/ |
| 28 | mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/rest/ |
| 29 | mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/ajsc-jetty/gc/ |
| 30 | mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/dmaapAAIEventConsumer/ |
| 31 | mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/perf-audit/ |
| 32 | mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/rest/ |
| 33 | mkdir -p /config-init/$NAMESPACE/aai/sparky-be/logs/ |
| 34 | mkdir -p /config-init/$NAMESPACE/aai/elasticsearch/es-data/ |
Mandeep Khinda | d6ea987 | 2017-06-24 11:49:37 -0400 | [diff] [blame] | 35 | |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 36 | chmod -R 777 /config-init/$NAMESPACE/sdc/logs/ |
Mandeep Khinda | 82c63d3 | 2017-08-21 16:04:37 -0400 | [diff] [blame] | 37 | chmod -R 777 /config-init/$NAMESPACE/portal/logs/ |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 38 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/ |
| 39 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/ |
| 40 | chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/ |
Mandeep Khinda | 9cd2211 | 2017-08-30 14:40:13 +0000 | [diff] [blame^] | 41 | chmod -R 777 /config-init/$NAMESPACE/aai/model-loader/logs/ |
| 42 | chmod -R 777 /config-init/$NAMESPACE/aai/haproxy/log/ |
| 43 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-traversal/logs/ |
| 44 | chmod -R 777 /config-init/$NAMESPACE/aai/aai-resources/logs/ |
| 45 | chmod -R 777 /config-init/$NAMESPACE/aai/sparky-be/logs/ |
| 46 | chmod -R 777 /config-init/$NAMESPACE/aai/elasticsearch/es-data/ |
Mike Elliott | d17accd | 2017-08-14 16:21:40 -0400 | [diff] [blame] | 47 | |
| 48 | # 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^] | 49 | find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/\.onap-/\.$NAMESPACE-/g" {} \; |