blob: 5597527238a1099c103a56edfda582678c185ad1 [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 Khindad6ea9872017-06-24 11:49:37 -040023
Mike Elliottd17accd2017-08-14 16:21:40 -040024chmod -R 777 /config-init/$NAMESPACE/sdc/logs/
Mandeep Khinda82c63d32017-08-21 16:04:37 -040025chmod -R 777 /config-init/$NAMESPACE/portal/logs/
Mike Elliottd17accd2017-08-14 16:21:40 -040026chmod -R 777 /config-init/$NAMESPACE/aai/aai-config/
27chmod -R 777 /config-init/$NAMESPACE/aai/aai-data/
28chmod -R 777 /config-init/$NAMESPACE/aai/opt/aai/logroot/
29
30# replace the default 'onap' namespace qualification of K8s hostnames within the config files
31find /config-init/$NAMESPACE/ -type f -exec sed -i -e "s/onap-/$NAMESPACE-/g" {} \;