blob: 5bc6dd33ef3df90d0f31a2caff3e61c5caed5137 [file] [log] [blame]
Mandeep Khindad6ea9872017-06-24 11:49:37 -04001#!/bin/bash
Mike Elliottd17accd2017-08-14 16:21:40 -04002#make NAMESPACE directory
3mkdir -p /config-init/$NAMESPACE/
Mandeep Khindad6ea9872017-06-24 11:49:37 -04004
Mike Elliottd17accd2017-08-14 16:21:40 -04005#unzip the configs in the NAMESPACEs directory ensuring no overwriting of files
6cp -vnpr /opt/config/src/* /config-init/$NAMESPACE/
Mandeep Khindad6ea9872017-06-24 11:49:37 -04007
8#ensure db directories exist.
Mike Elliottd17accd2017-08-14 16:21:40 -04009mkdir -p /config-init/$NAMESPACE/appc/data/
10mkdir -p /config-init/$NAMESPACE/dcae/pgaas/pgdata/
11mkdir -p /config-init/$NAMESPACE/portal/mariadb/data/
Mandeep Khinda82c63d32017-08-21 16:04:37 -040012mkdir -p /config-init/$NAMESPACE/portal/logs/
Mike Elliottd17accd2017-08-14 16:21:40 -040013mkdir -p /config-init/$NAMESPACE/sdnc/data/
14mkdir -p /config-init/$NAMESPACE/vid/mariadb/data/
15mkdir -p /config-init/$NAMESPACE/sdc/sdc-cs/CS/
16mkdir -p /config-init/$NAMESPACE/sdc/sdc-es/ES/
17mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-ES/
18mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-CS/
19mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-KB/
20mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-BE/
21mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-FE/
22mkdir -p /config-init/$NAMESPACE/aai/opt/aai/logroot/
Mandeep Khinda9cd22112017-08-30 14:40:13 +000023mkdir -p /config-init/$NAMESPACE/aai/model-loader/logs/
24mkdir -p /config-init/$NAMESPACE/aai/haproxy/log/
25mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/ajsc-jetty/gc/
26mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/dmaapAAIEventConsumer/
27mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/perf-audit/
28mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/rest/
29mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/ajsc-jetty/gc/
30mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/dmaapAAIEventConsumer/
31mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/perf-audit/
32mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/rest/
33mkdir -p /config-init/$NAMESPACE/aai/sparky-be/logs/
34mkdir -p /config-init/$NAMESPACE/aai/elasticsearch/es-data/
Mandeep Khindad6ea9872017-06-24 11:49:37 -040035
Mike Elliottd17accd2017-08-14 16:21:40 -040036chmod -R 777 /config-init/$NAMESPACE/sdc/logs/
Mandeep Khinda82c63d32017-08-21 16:04:37 -040037chmod -R 777 /config-init/$NAMESPACE/portal/logs/
Mike Elliottd17accd2017-08-14 16:21:40 -040038chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/
39chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/
40chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/
Mandeep Khinda9cd22112017-08-30 14:40:13 +000041chmod -R 777 /config-init/$NAMESPACE/aai/model-loader/logs/
42chmod -R 777 /config-init/$NAMESPACE/aai/haproxy/log/
43chmod -R 777 /config-init/$NAMESPACE/aai/aai-traversal/logs/
44chmod -R 777 /config-init/$NAMESPACE/aai/aai-resources/logs/
45chmod -R 777 /config-init/$NAMESPACE/aai/sparky-be/logs/
46chmod -R 777 /config-init/$NAMESPACE/aai/elasticsearch/es-data/
Mike Elliottd17accd2017-08-14 16:21:40 -040047
48# replace the default 'onap' namespace qualification of K8s hostnames within the config files
Mandeep Khinda9cd22112017-08-30 14:40:13 +000049find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/\.onap-/\.$NAMESPACE-/g" {} \;