move policy config to onap 1.1
[oom.git] / kubernetes / config / docker / init / src / config / policy / opt / policy / config / pe / brmsgw-tweaks.sh
1 #! /bin/bash
2
3 PROPS_BUILD="${POLICY_HOME}/etc/build.info"
4
5 PROPS_RUNTIME="${POLICY_HOME}/servers/brmsgw/config.properties"
6 PROPS_INSTALL="${POLICY_HOME}/install/servers/brmsgw/config.properties"
7
8
9 if [ ! -f "${PROPS_BUILD}" ]; then
10         echo "error: version information does not exist: ${PROPS_BUILD}"
11         exit 1
12 fi
13
14 source "${POLICY_HOME}/etc/build.info"
15
16 if [ -z "${version}" ]; then
17         echo "error: no version information present"
18         exit 1
19 fi
20
21 for CONFIG in ${PROPS_RUNTIME} ${PROPS_INSTALL}; do
22         if [ ! -f "${CONFIG}" ]; then
23                 echo "warning: configuration does not exist: ${CONFIG}"
24         else
25                 sed -i -e "s/brms.dependency.version=.*/brms.dependency.version=${version}/g" "${CONFIG}"
26         fi
27 done
28
29 DEPS_JSON_RUNTIME="${POLICY_HOME}/servers/brmsgw/dependency.json"
30 DEPS_JSON_INSTALL="${POLICY_HOME}/install/servers/brmsgw/dependency.json"
31
32 for DEP in ${DEPS_JSON_RUNTIME} ${DEPS_JSON_INSTALL}; do
33         if [ ! -f "${DEP}" ]; then
34                 echo "warning: configuration does not exist: ${DEP}"
35         else
36                 sed -i -e "s/\"version\":.*/\"version\": \"${version}\"/g" "${DEP}"
37         fi
38 done