blob: 15b4181a7517a6a3551e543ceee69f83cd99ff58 [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/
Mandeep Khinda76092d62017-09-01 02:15:17 +000025mkdir -p /config-init/$NAMESPACE/aai/aai-traversal/logs/
26mkdir -p /config-init/$NAMESPACE/aai/aai-resources/logs/
Mandeep Khinda9cd22112017-08-30 14:40:13 +000027mkdir -p /config-init/$NAMESPACE/aai/sparky-be/logs/
28mkdir -p /config-init/$NAMESPACE/aai/elasticsearch/es-data/
Mandeep Khinda76092d62017-09-01 02:15:17 +000029mkdir -p /config-init/$NAMESPACE/aai/search-data-service/logs/
30mkdir -p /config-init/$NAMESPACE/aai/data-router/logs/
BorislavG66a9a5c2017-09-06 15:12:46 +030031mkdir -p /config-init/$NAMESPACE/mso/mariadb/data
Mandeep Khindad6ea9872017-06-24 11:49:37 -040032
Mike Elliottd17accd2017-08-14 16:21:40 -040033chmod -R 777 /config-init/$NAMESPACE/sdc/logs/
Mandeep Khinda82c63d32017-08-21 16:04:37 -040034chmod -R 777 /config-init/$NAMESPACE/portal/logs/
Mike Elliottd17accd2017-08-14 16:21:40 -040035chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/
36chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/
37chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/
Mandeep Khinda9cd22112017-08-30 14:40:13 +000038chmod -R 777 /config-init/$NAMESPACE/aai/model-loader/logs/
39chmod -R 777 /config-init/$NAMESPACE/aai/haproxy/log/
40chmod -R 777 /config-init/$NAMESPACE/aai/aai-traversal/logs/
41chmod -R 777 /config-init/$NAMESPACE/aai/aai-resources/logs/
42chmod -R 777 /config-init/$NAMESPACE/aai/sparky-be/logs/
43chmod -R 777 /config-init/$NAMESPACE/aai/elasticsearch/es-data/
Mandeep Khinda76092d62017-09-01 02:15:17 +000044chmod -R 777 /config-init/$NAMESPACE/aai/search-data-service/logs/
45chmod -R 777 /config-init/$NAMESPACE/aai/data-router/logs/
BorislavG66a9a5c2017-09-06 15:12:46 +030046chmod -R 777 /config-init/$NAMESPACE/policy/mariadb/
Mandeep Khinda76092d62017-09-01 02:15:17 +000047
Mike Elliottd17accd2017-08-14 16:21:40 -040048
49# replace the default 'onap' namespace qualification of K8s hostnames within the config files
Mandeep Khinda9cd22112017-08-30 14:40:13 +000050find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/\.onap-/\.$NAMESPACE-/g" {} \;