Files
my-rook-config/tests/scripts/validate_modified_files.sh
T
subhamkrai 3c591ff7a1 ci: update make crds-gen to make crds
this commit update make crds-gen to make crds

Signed-off-by: subhamkrai <srai@redhat.com>
2021-03-26 15:48:18 +05:30

43 lines
755 B
Bash
Executable File

#!/bin/bash
set -ex
#############
# VARIABLES #
#############
CODEGEN_ERR="found codegen files! please run 'make codegen' and update your PR"
MOD_ERR="changes found by mod.check. You may need to run make clean"
CRD_ERR="changes found by 'make crds'. please run 'make crds' locally and update your PR"
#############
# FUNCTIONS #
#############
function validate(){
git=$(git status --porcelain)
for file in $git; do
if [ -n "$file" ]; then
echo "$1"
echo "$git"
git diff
exit 1
fi
done
}
########
# MAIN #
########
case "$1" in
codegen)
validate "$CODEGEN_ERR"
;;
modcheck)
validate "$MOD_ERR"
;;
crd)
validate "$CRD_ERR"
;;
*)
echo $"Usage: $0 {codegen|modcheck|crd}"
exit 1
esac