mirror of https://git.rancher.io/charts
Run helm dependency on every chart
parent
c1ede43dc1
commit
943d41ec5b
|
@ -39,38 +39,34 @@ for f in packages/*; do
|
||||||
if [[ "${split_crds}" == "true" ]]; then
|
if [[ "${split_crds}" == "true" ]]; then
|
||||||
./scripts/prepare-crds ${f}
|
./scripts/prepare-crds ${f}
|
||||||
fi
|
fi
|
||||||
copied_dependencies=()
|
|
||||||
if [[ -f ${f}/charts/requirements.yaml ]]; then
|
|
||||||
repos=$(cat ${f}/charts/requirements.yaml | yq r - "dependencies.*.repository")
|
|
||||||
while IFS= read -r repo; do
|
|
||||||
if [[ ${repo} == file://* ]]; then
|
|
||||||
charts_path=${repo/file:\/\//${f}/charts/}
|
|
||||||
overlay_path=${repo/file:\/\//${f}/overlay/}
|
|
||||||
if [[ ! -d $charts_path ]] && [[ -d $overlay_path ]]; then
|
|
||||||
cp -R $overlay_path $charts_path
|
|
||||||
copied_dependencies+=("${charts_path}")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done < <(echo "${repos}")
|
|
||||||
fi
|
|
||||||
pwd=$(pwd)
|
|
||||||
cd ${f}/charts
|
|
||||||
helm dependency update
|
|
||||||
cd $pwd
|
|
||||||
for dep in "${copied_dependencies[@]}"; do
|
|
||||||
rm -rf $dep
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# if any sub-charts were prepared pull them in
|
# Loop through packages again and copy dependencies over
|
||||||
|
# If sub-charts existed as package.yaml they will now be vendored into parent
|
||||||
for f in packages/*; do
|
for f in packages/*; do
|
||||||
if [[ ! -f ${f}/package.yaml && -f ${f}/charts/requirements.yaml ]]; then
|
if [[ -z $CHART || $CHART == $(basename -- ${f}) ]]; then
|
||||||
ls ${f}/charts/requirements.yaml
|
copied_dependencies=()
|
||||||
|
if [[ -f ${f}/charts/requirements.yaml ]]; then
|
||||||
|
repos=$(cat ${f}/charts/requirements.yaml | yq r - "dependencies.*.repository")
|
||||||
|
while IFS= read -r repo; do
|
||||||
|
if [[ ${repo} == file://* ]]; then
|
||||||
|
charts_path=${repo/file:\/\//${f}/charts/}
|
||||||
|
overlay_path=${repo/file:\/\//${f}/overlay/}
|
||||||
|
if [[ ! -d $charts_path ]] && [[ -d $overlay_path ]]; then
|
||||||
|
cp -R $overlay_path $charts_path
|
||||||
|
copied_dependencies+=("${charts_path}")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done < <(echo "${repos}")
|
||||||
|
fi
|
||||||
pwd=$(pwd)
|
pwd=$(pwd)
|
||||||
cd ${f}/charts
|
cd ${f}/charts
|
||||||
helm dependency update
|
helm dependency update
|
||||||
cd $pwd
|
cd $pwd
|
||||||
|
for dep in "${copied_dependencies[@]}"; do
|
||||||
|
rm -rf $dep
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -50,7 +50,7 @@ for crd_yaml in ${f}/charts-crd/templates/*; do
|
||||||
crd_group=$(yq r ${crd_yaml} 'spec.group')
|
crd_group=$(yq r ${crd_yaml} 'spec.group')
|
||||||
crd_kind=$(yq r ${crd_yaml} 'spec.names.kind')
|
crd_kind=$(yq r ${crd_yaml} 'spec.names.kind')
|
||||||
crd_version=$(yq r ${crd_yaml} 'spec.version')
|
crd_version=$(yq r ${crd_yaml} 'spec.version')
|
||||||
if test -z "$crd_version"; then
|
if [[ -z "$crd_version" ]]; then
|
||||||
crd_version=$(yq r ${crd_yaml} 'spec.versions[0].name')
|
crd_version=$(yq r ${crd_yaml} 'spec.versions[0].name')
|
||||||
fi
|
fi
|
||||||
crd_apis+=("${crd_group}/${crd_version}/${crd_kind}")
|
crd_apis+=("${crd_group}/${crd_version}/${crd_kind}")
|
||||||
|
|
Loading…
Reference in New Issue