-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update helm release argo-cd to v6.8.0 (#138)
* Update Helm release argo-cd to v6.8.0 * solve 'comment is too long' * Update gitops-diff.yaml * Update gitops-diff.yaml * Update gitops-diff.yaml * Update gitops-diff.yaml * Update gitops-diff.yaml * Update gitops-diff.yaml * Update gitops-diff.yaml * Create create-pr-comment-file.sh * Update gitops-diff.yaml * Update gitops-diff.yaml * Update create-pr-comment-file.sh * Update gitops-diff.yaml * create pr comments with body limits respected Signed-off-by: Johannes Kleinlercher <[email protected]> * use pr-comment-file.sh from repo without downloading Signed-off-by: Johannes Kleinlercher <[email protected]> * fix double suffix Signed-off-by: Johannes Kleinlercher <[email protected]> * fix output Signed-off-by: Johannes Kleinlercher <[email protected]> * run sequentially so diff comments are in their right order Signed-off-by: Johannes Kleinlercher <[email protected]> * add outputs variable Signed-off-by: Johannes Kleinlercher <[email protected]> * use upload and download because matrix jobs need comment-files Signed-off-by: Johannes Kleinlercher <[email protected]> * default values not in matrix action Signed-off-by: Johannes Kleinlercher <[email protected]> * define dependency to diff Signed-off-by: Johannes Kleinlercher <[email protected]> * show values diff after rendered template diff Signed-off-by: Johannes Kleinlercher <[email protected]> * split on diff so you know what was compared Signed-off-by: Johannes Kleinlercher <[email protected]> * don't compare with values.yaml, because it is already used by default Signed-off-by: Johannes Kleinlercher <[email protected]> --------- Signed-off-by: Johannes Kleinlercher <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Johannes Kleinlercher <[email protected]>
- Loading branch information
1 parent
0519dea
commit f312148
Showing
5 changed files
with
124 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p out/pr | ||
mkdir -p out/target | ||
mkdir -p out-default-values/pr | ||
mkdir -p out-default-values/target | ||
mkdir -p comment-files | ||
for env in pr target; do | ||
cd ${env}/platform-apps/charts | ||
for chart in $( ls ); do | ||
echo ${chart} | ||
helm dependency update ${chart} | ||
for value in $( find ${chart} -type f -name "values-*" ); do | ||
valuefile=$( basename ${value} ) | ||
helm template ${chart} -f ${value} > ../../../out/${env}/${chart}_${valuefile}.out | ||
done | ||
# get default values of subchart | ||
helm show values ${chart}/charts/* > ../../../out-default-values/${env}/${chart}_default-values.out || true | ||
done | ||
cd - | ||
done | ||
diff -U 7 -r out-default-values/target out-default-values/pr > out/default-values-diff.txt || true | ||
diff -U 7 -r out/target out/pr > out/diff.txt || true | ||
csplit -f comment-files/comment out/diff.txt --elide-empty-files /^diff\ \-U/ '{*}' | ||
|
||
comment_files_csplit=$( find comment-files -type f | sort ) | ||
|
||
# Define the maximum size in bytes | ||
MAX_SIZE=131072 | ||
|
||
# Initialize output file counter and base name | ||
OUTPUT_BASE_NAME="combined_file" | ||
output_file_count=1 | ||
OUTPUT_FILE="${OUTPUT_BASE_NAME}_${output_file_count}.txt" | ||
|
||
# Remove existing files with the same base name to start fresh | ||
rm -f "${OUTPUT_BASE_NAME}_*.txt" | ||
|
||
# Current size of the output file | ||
current_size=0 | ||
|
||
# Loop through all the files passed as arguments to the script | ||
for file in ${comment_files_csplit}; do | ||
if [ -f "$file" ]; then # Check if the argument is a valid file | ||
# Get the size of the file to be added | ||
file_size=$(stat -c %s "$file") | ||
|
||
# Check if adding this file will exceed the limit | ||
if (( current_size + file_size > MAX_SIZE )); then | ||
# Start a new output file | ||
output_file_count=$((output_file_count + 1)) | ||
OUTPUT_FILE="${OUTPUT_BASE_NAME}_${output_file_count}.txt" | ||
current_size=0 # Reset current size for the new output file | ||
|
||
echo "Reached size limit. Creating new output file: $OUTPUT_FILE." | ||
fi | ||
|
||
# Concatenate the file to the current output file | ||
cat "$file" >> "$OUTPUT_FILE" | ||
|
||
# Update the current size | ||
current_size=$((current_size + file_size)) | ||
|
||
echo "Added '$file' to '$OUTPUT_FILE'. Current size: $current_size bytes." | ||
else | ||
echo "'$file' is not a valid file. Skipping." | ||
fi | ||
done | ||
|
||
echo "Concatenation completed. Total output files: $output_file_count." | ||
|
||
combined_files=$( ls combined_file* ) | ||
for combined_file in ${combined_files} ; do | ||
sed 's/DESCRIPTION_HERE/Changes Rendered Chart/g' pr/.github/pr-diff-template.txt > out/comment-diff-${combined_file} | ||
sed -e "/DIFF_HERE/{r ${combined_file}" -e "d}" out/comment-diff-${combined_file} > comment-files/comment-result-${combined_file} | ||
done | ||
|
||
# default values comparison (we assume they will not be bigger than comment size limit) | ||
sed 's/DESCRIPTION_HERE/Changes Default Values/g' pr/.github/pr-diff-template.txt > out/comment-diff-default-values.txt | ||
sed -e "/DIFF_HERE/{r out/default-values-diff.txt" -e "d}" out/comment-diff-default-values.txt > comment-files/comment-default-values-result.txt | ||
|
||
|
||
# output for matrix build | ||
echo "matrix={\"comment-files\": $( jq -n '$ARGS.positional' --args $( ls comment-files/comment-result-* ) | tr "\n" " ")}" >> $GITHUB_OUTPUT | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 6.7.18 | ||
digest: sha256:b6f661f88a3ea5d69f67e91bd9b3e538dea7d85d79abd486ed04e65b35f20ab3 | ||
generated: "2024-04-30T17:44:02.308037142Z" | ||
version: 6.8.0 | ||
digest: sha256:6a6ad8cb1e483618b6756d8d4813530e7c1d83c3b23c885fd068bbac73195021 | ||
generated: "2024-05-08T08:26:21.980977019Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters