-function parse_yaml() {
- [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- TAG=$1
- shift
- services=$@
- for module in $services; do
- if [ "$module" == "pla" ]; then
- if [ -n "$INSTALL_PLA" ]; then
- echo "Updating K8s manifest file from opensourcemano\/pla:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/pla:${TAG}"
- sudo sed -i "s#opensourcemano/pla:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/pla:${TAG}#g" ${OSM_DOCKER_WORK_DIR}/osm_pla/pla.yaml
- fi
- else
- image=${module}
- if [ "$module" == "ng-prometheus" ]; then
- image="prometheus"
- fi
- echo "Updating K8s manifest file from opensourcemano\/${image}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${image}:${TAG}"
- sudo sed -i "s#opensourcemano/${image}:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/${image}:${TAG}#g" ${OSM_K8S_WORK_DIR}/${module}.yaml
- fi
- done
- [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-
-function update_manifest_files() {
- osm_services="nbi lcm ro pol mon ng-ui keystone pla prometheus ng-prometheus"
- list_of_services=""
- for module in $osm_services; do
- module_upper="${module^^}"
- if ! echo $TO_REBUILD | grep -q $module_upper ; then
- list_of_services="$list_of_services $module"
- fi
- done
- if [ ! "$OSM_DOCKER_TAG" == "13" ]; then
- parse_yaml $OSM_DOCKER_TAG $list_of_services
- fi
- if [ -n "$MODULE_DOCKER_TAG" ]; then
- parse_yaml $MODULE_DOCKER_TAG $list_of_services_to_rebuild
- fi
- # The manifest for prometheus is prometheus.yaml or ng-prometheus.yaml, depending on the installation option
- if [ -n "$INSTALL_NGSA" ]; then
- sudo rm -f ${OSM_K8S_WORK_DIR}/prometheus.yaml
- else
- sudo rm -f ${OSM_K8S_WORK_DIR}/ng-prometheus.yaml
- sudo rm -f ${OSM_K8S_WORK_DIR}/webhook-translator.yaml
- fi
- [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-
-function namespace_vol() {
- [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- # List of services with a volume mounted in path /var/lib/osm
- osm_services="mysql"
- for osm in $osm_services; do
- if [ -f "$OSM_K8S_WORK_DIR/$osm.yaml" ] ; then
- sudo sed -i "s#path: /var/lib/osm#path: $OSM_NAMESPACE_VOL#g" $OSM_K8S_WORK_DIR/$osm.yaml
- fi
- done
- [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-