fix(ci): yq requires -y for in place changes (#3343)

* fix(ci): yq requires -y for in place changes

* fix cat
This commit is contained in:
Stavros Kois
2022-07-29 18:57:35 +03:00
committed by GitHub
parent 19d98e4366
commit 8ef157368e
2 changed files with 11 additions and 11 deletions

View File

@@ -32,23 +32,23 @@ sync_tag() {
sed -i -e "s|icon: .*|icon: https:\/\/truecharts.org\/img\/chart-icons\/${chartname}.png|" "${chart}/Chart.yaml"
echo "Updating home of ${chartname}..."
sed -i -e "s|home: .*|home: https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}|" "${chart}/Chart.yaml"
echo "Updating sources of ${chartname}..." # Get all sources (except truecharts)
echo "Updating sources of ${chartname}..."
# Get all sources (except truecharts)
curr_sources=$(yq '.sources[] | select(. != "https://github.com/truecharts*")' "${chart}/Chart.yaml")
echo "${chartname}: $curr_sources"
echo "${chartname}: After getting all sources"
cat "${chartname}: ${chart}/Chart.yaml"
cat "${chart}/Chart.yaml"
# Empty sources list in-place
yq -i 'del(.sources.[])' "${chart}/Chart.yaml"
yq -yi 'del(.sources.[])' "${chart}/Chart.yaml"
echo "${chartname}: After deleting all sources"
cat "${chartname}: ${chart}/Chart.yaml"
cat "${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"
tcsource="https://github.com/truecharts/charts/tree/master/charts/$train/$chartname" yq -yi '.sources += env(tcsource)' "${chart}/Chart.yaml"
echo "${chartname}: After adding tc source"
cat "${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"
src="$line" yq -yi '.sources += env(src)' "${chart}/Chart.yaml"
done <<< "$curr_sources"
echo "${chartname}: After adding the rest of the sources"
cat "${chart}/Chart.yaml"