feat(ci): Auto add/update/replace sources with TC git repo link (#3336)

* no need to quote the link

* auto add/replace/update source with tc git repo link
This commit is contained in:
Stavros Kois
2022-07-29 03:17:37 +03:00
committed by GitHub
parent c5a3c5a010
commit 9a85dee993
2 changed files with 22 additions and 2 deletions

View File

@@ -27,7 +27,17 @@ sync_tag() {
tag="${tag%_}"
tag="${tag%.}"
sed -i -e "s|appVersion: .*|appVersion: \"${tag}\"|" "${chart}/Chart.yaml"
sed -i -e "s|home: .*|home: \"https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}\"|" "${chart}/Chart.yaml"
sed -i -e "s|home: .*|home: https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}|" "${chart}/Chart.yaml"
# Get all sources (except truecharts)
curr_sources=$(yq '.sources[] | select(. != "https://github.com/truecharts*")' "${chart}/Chart.yaml")
# Empty sources list in-place
yq -i 'del(.sources.[])' "${chart}/Chart.yaml"
# Add truechart source
tcsource="https://github.com/truecharts/charts/tree/master/charts/$train/$chartname" yq -i '.sources += env(tcsource)' "${chart}/Chart.yaml"
# Add the rest of the sources
while IFS= read -r line; do
src="$line" yq -i '.sources += env(src)' "${chart}/Chart.yaml"
done <<< "$curr_sources"
}
export -f sync_tag