diff options
-rwxr-xr-x | share/hydra/module-update | 8 | ||||
-rwxr-xr-x | share/hydra/module-verify | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/share/hydra/module-update b/share/hydra/module-update index 3887bd2..ac19b57 100755 --- a/share/hydra/module-update +++ b/share/hydra/module-update @@ -21,4 +21,12 @@ fi # Update the module ( cd $PUPPET/modules/$MODULE; git pull origin master ) + +# Verify the module +if ! hydra $HYDRA module-verify $MODULE; then + echo "ERROR: Updated module doesn't match hash, please verify and update manually." + exit 1 +fi + +# Commit ( cd $PUPPET; git commit -a -m "Updating module $MODULE"; git push ) diff --git a/share/hydra/module-verify b/share/hydra/module-verify index 81afbfe..5a4d164 100755 --- a/share/hydra/module-verify +++ b/share/hydra/module-verify @@ -17,11 +17,11 @@ elif [ -z "$HYDRA_FOLDER" ] || [ ! -e "$HYDRA_FOLDER/modules" ]; then fi cd $PUPPET -HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }'`" +HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }' | sed -e 's/\+//'`" cd $HYDRA_FOLDER/modules/$MODULE -HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }'`" +HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }' | sed -e 's/\+//'`" if [ "$HASH_MODULE" != "$HASH_SUBMODULE" ]; then echo "Module $MODULE: hash differ!!:" |