2 # ============LICENSE_START===============================================
3 # Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
4 # ========================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=================================================
19 echo "######### Patching Sample rApps #########"
22 export WORKSPACE="$CWD/../../sample-rapp-generator"
24 IP_ADDRESS=$(hostname -I | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | awk '{print $1}')
25 echo "IP Address : $IP_ADDRESS"
27 CHART_REPO_GET_URI=${CHART_REPO_GET_URI:-'http://'$IP_ADDRESS':8879/charts'}
28 CHART_REPO_POST_URI=${CHART_REPO_POST_URI:-'http://'$IP_ADDRESS':8879/charts/api/charts'}
30 echo "Replacing charts repo post url in yaml files....."
31 echo "Chart repository post URI : $CHART_REPO_POST_URI"
32 for file in $(find $WORKSPACE -type f -name "*.yaml"); do
33 sed -i "s|UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI|${CHART_REPO_POST_URI}|g" "$file"
34 if grep -q "$CHART_REPO_POST_URI" "$file"; then
35 echo "$file is updated."
39 echo "Replacing charts repo get url in json files....."
40 echo "Chart repository get URI : $CHART_REPO_GET_URI"
41 for file in $(find $WORKSPACE -type f -name "*.json"); do
42 sed -i "s|UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI|${CHART_REPO_GET_URI}|g" "$file"
43 if grep -q "$CHART_REPO_GET_URI" "$file"; then
44 echo "$file is updated."
48 echo "Patching Sample rApps completed."