diff --git a/.github/scripts/create-values-diff.sh b/.github/scripts/create-values-diff.sh index 8bed37353..76c22eafd 100755 --- a/.github/scripts/create-values-diff.sh +++ b/.github/scripts/create-values-diff.sh @@ -92,11 +92,17 @@ function generateComment() { mkdir "$originalResourcesDir" "$newResourcesDir" - "$SCRIPTS/templateGitHelmChart" -1 "$GITHUB_REPO_URL" "$chart" "${GITHUB_DEFAULT_BRANCH}" "$values" | yq -y -S >"$originalResourcesDir.yaml" - splitYamlIntoDir "$originalResourcesDir.yaml" "$originalResourcesDir" + ( + "$SCRIPTS/templateGitHelmChart" -1 "$GITHUB_REPO_URL" "$chart" "${GITHUB_DEFAULT_BRANCH}" "$values" | yq -y -S >"$originalResourcesDir.yaml" + splitYamlIntoDir "$originalResourcesDir.yaml" "$originalResourcesDir" + ) & + + ( + "$SCRIPTS/templateLocalHelmChart" -1 "$chart" "$values" | yq -y -S >"$newResourcesDir.yaml" + splitYamlIntoDir "$newResourcesDir.yaml" "$newResourcesDir" + ) & - "$SCRIPTS/templateLocalHelmChart" -1 "$chart" "$values" | yq -y -S >"$newResourcesDir.yaml" - splitYamlIntoDir "$newResourcesDir.yaml" "$newResourcesDir" + wait ) & done wait diff --git a/.github/scripts/templateHelmChart.sh b/.github/scripts/templateHelmChart.sh index 47fd43163..fdfe4a3a2 100755 --- a/.github/scripts/templateHelmChart.sh +++ b/.github/scripts/templateHelmChart.sh @@ -24,7 +24,8 @@ function templateGitHelmRelease() { git checkout -q "$gitRef" ) >/dev/null - helm dependency update "$tmpDir/$gitPath" >/dev/null + source <(helm env) + flock --close "${HELM_REPOSITORY_CACHE}" helm dependency update "$tmpDir/$gitPath" >/dev/null helm template ${namespace:+--namespace "$namespace"} "$releaseName" "$tmpDir/$gitPath" --values <(if [[ -f "$values" ]]; then cat "$values"; else echo "$values"; fi) }