blob: f751f4d1ca386d54b40e737c6c5c4e9368ebddd5 [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/
12mkdir -p /config-init/$NAMESPACE/sdnc/data/
13mkdir -p /config-init/$NAMESPACE/vid/mariadb/data/
14mkdir -p /config-init/$NAMESPACE/sdc/sdc-cs/CS/
15mkdir -p /config-init/$NAMESPACE/sdc/sdc-es/ES/
16mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-ES/
17mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-CS/
18mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-KB/
19mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-BE/
20mkdir -p /config-init/$NAMESPACE/sdc/logs/ASDC/ASDC-FE/
21mkdir -p /config-init/$NAMESPACE/aai/opt/aai/logroot/
Mandeep Khindad6ea9872017-06-24 11:49:37 -040022
Mike Elliottd17accd2017-08-14 16:21:40 -040023chmod -R 777 /config-init/$NAMESPACE/sdc/logs/
24chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/
25chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/
26chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/
27
28# replace the default 'onap' namespace qualification of K8s hostnames within the config files
29find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/onap-/$NAMESPACE-/g" {} \;