diff --git a/manifest-analyzer/dyff.sh b/manifest-analyzer/dyff.sh index 6357a53..2f35124 100755 --- a/manifest-analyzer/dyff.sh +++ b/manifest-analyzer/dyff.sh @@ -9,15 +9,23 @@ head_manifest=head.yaml output_file=dyff.md function get_emoji() { - if [[ $1 -eq 0 ]]; then + if [[ $1 -eq 0 || $1 -eq 1 ]]; then echo ✅ - elif [[ $1 -eq 1 ]]; then - echo 💡 else echo 💥 fi } +function get_message() { + if [[ $1 -eq 0 ]]; then + echo "no changes detected 🎉" + elif [[ $1 -eq 1 ]]; then + echo "some changes detected 👀" + else + echo "dyff failed" + fi +} + diff_output="" if [[ -s "$base_manifest" ]]; then diff_output=$(dyff between "$base_manifest" "$head_manifest" --color off --set-exit-code 2>&1) @@ -31,6 +39,8 @@ rc=$? tee "$output_file" << EOS ### $(get_emoji $rc) dyff [$head_dir] +$(get_message $rc) +
show outputs \`\`\`diff diff --git a/manifest-analyzer/kustomize.sh b/manifest-analyzer/kustomize.sh index 33874d7..e5ab9cd 100755 --- a/manifest-analyzer/kustomize.sh +++ b/manifest-analyzer/kustomize.sh @@ -12,13 +12,15 @@ echo "kustomize head directory: $head_dir" echo "working directory: $(pwd)" if [[ -d "$base_dir" ]]; then - kustomize build "$base_dir" > "$base_manifest" + echo "kustomize build $base_dir" + kustomize build "$base_dir" -o "$base_manifest" else touch "$base_manifest" fi if [[ -d "$head_dir" ]]; then - kustomize build "$head_dir" > "$head_manifest" + echo "kustomize build $head_dir" + kustomize build "$head_dir" -o "$head_manifest" else echo "head directory not found: $head_dir" exit 1