-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add readme generator pre-commit hook * apply fixes from running pre-commit run --all-files * bump chart versions of all charts * use GITHUB_TOKEN instead of PAT for checkout charts step * update permissions for GITHUB_TOKEN in helm-unittests job * include the ecs-inventory chart in readme-generator * add helm unit tests to pre-commit hooks (disabled by default) * use static chart version for snapshot tests * move value converter into its own directory --------- Signed-off-by: Brady Todhunter <[email protected]>
- Loading branch information
1 parent
bddabb2
commit 8ecc1b8
Showing
106 changed files
with
282 additions
and
231 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -41,4 +41,3 @@ jobs: | |
id: lint | ||
run: ct lint --config 'ct-config.yaml' | ||
if: steps.list-changed.outputs.CHANGED == 'true' | ||
|
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
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 |
---|---|---|
|
@@ -32,4 +32,3 @@ if [ "${do_push}" == "true" ]; then | |
else | ||
echo "Skipping push" | ||
fi | ||
|
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
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
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 |
---|---|---|
|
@@ -292,4 +292,4 @@ def merge_dicts(dict1, dict2): | |
else: | ||
merged_dict[key] = value | ||
|
||
return merged_dict | ||
return merged_dict |
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
readonly DEBUG=${DEBUG:-unset} | ||
if [ "${DEBUG}" != unset ]; then | ||
set -x | ||
fi | ||
|
||
if [[ ! $(which helm) ]]; then | ||
echo "helm not found. Please install helm and try again" | ||
exit 1 | ||
fi | ||
|
||
if ! helm plugin list | grep -q unittest; then | ||
echo "helm-unittest plugin not found. Press 'y' to install with helm or any other key to skip" | ||
read -r install_helm_unittest | ||
if [[ "$install_helm_unittest" != "y" ]]; then | ||
exit 1 | ||
fi | ||
helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
fi | ||
|
||
files_changed="$(git diff --name-only origin/main | sort | uniq)" | ||
# Adding || true to avoid "Process exited with code 1" errors | ||
charts_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "stable/[^/]*" | sort | uniq || true)" | ||
|
||
charts_to_test=("stable/enterprise" "stable/feeds") | ||
|
||
for chart in ${charts_dirs_changed}; do | ||
for charts_to_test in "${charts_to_test[@]}"; do | ||
if [[ "$chart" == "$charts_to_test" ]]; then | ||
echo "Running unit tests for ${chart}" | ||
pushd "${chart}" || exit | ||
helm repo add anchore https://charts.anchore.io/stable | ||
helm dep up | ||
helm unittest . | ||
popd || exit | ||
fi | ||
done | ||
done |
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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
readonly DEBUG=${DEBUG:-unset} | ||
if [ "${DEBUG}" != unset ]; then | ||
set -x | ||
fi | ||
|
||
if [[ ! $(which readme-generator) ]]; then | ||
echo "readme-generator not found. Press 'y' to install with npm or any other key to skip" | ||
read -r install_readme_generator | ||
if [[ "$install_readme_generator" != "y" ]]; then | ||
exit 1 | ||
fi | ||
if [[ ! $(which npm) ]]; then | ||
echo "npm not found. Please install npm and try again" | ||
exit 1 | ||
fi | ||
npm install -g @bitnami/readme-generator-for-helm | ||
fi | ||
|
||
files_changed="$(git diff --name-only origin/main | sort | uniq)" | ||
# Adding || true to avoid "Process exited with code 1" errors | ||
charts_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "stable/[^/]*" | sort | uniq || true)" | ||
|
||
chart_with_metadata=("stable/enterprise" "stable/feeds" "stable/ecs-inventory") | ||
|
||
for chart in ${charts_dirs_changed}; do | ||
for chart_with_metadata in "${chart_with_metadata[@]}"; do | ||
if [[ "$chart" == "$chart_with_metadata" ]]; then | ||
echo "Updating README.md for ${chart}" | ||
readme-generator --values "${chart}/values.yaml" --readme "${chart}/README.md" | ||
fi | ||
done | ||
done |
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
Oops, something went wrong.