-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathupdate_chart_repo.sh
executable file
·53 lines (44 loc) · 1.51 KB
/
update_chart_repo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Steps for new helm charts release v0.9rc as example.
# This should be implemented in CICD workflow.
# 0. Charts tag updated for this branch
# 1. git clone -b https://github.com/opea-project/GenAIInfra.git
# 2. cd GenAIInfra; git switch v0.9rc; cp -rf helm-charts ../ # Copy the helm-charts directory
# 3. git switch charts-release; mv ../helm-charts . # Switch to charts-release and copy back the helm-charts directory
# 4. ./update_chart_repo.sh; rm -rf helm-charts
# 5. git add .; git commit -s -m "v0.9 charts release"; git push
# For 1.0 and later, include the gmc helm chart too
# cd microservice-connector/; helm package helm; cp gmc-1.0.0.tgz
UPD_DIR=$(cd $(dirname "$0") && pwd)
CHART_DIR=./helm-charts
# package_chart chartdir
function package_chart {
CHART=$1
helm package $1
}
pushd $UPD_DIR
# update components
for chart in $UPD_DIR/$CHART_DIR/common/*
do
echo "Packaging chart $chart..."
helm dependency update ${chart}
helm package $chart
done
# update E2E Applications
for chart in $UPD_DIR/$CHART_DIR/*
do
if [ -f $chart ]; then continue; fi
if [[ $chart =~ "common" ]]; then continue; fi
echo "Packaging chart $chart..."
helm dependency update ${chart}
helm package $chart
done
# rm helm-charts
rm -rf helm-charts
# Update Index
# mv index.yaml index.old
helm repo index .
# Insert copyright to avoid warnings
sed -i '1s/^/# Copyright (C) 2024 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\n/' index.yaml