summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/module-verify33
1 files changed, 33 insertions, 0 deletions
diff --git a/share/hydra/module-verify b/share/hydra/module-verify
new file mode 100755
index 0000000..81afbfe
--- /dev/null
+++ b/share/hydra/module-verify
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# Verify a puppet module
+#
+
+# Load
+source $APP_BASE/lib/hydra/functions || exit 1
+hydra_config_load
+
+MODULE="$1"
+
+if [ -z "$1" ]; then
+ exit
+elif [ -z "$HYDRA_FOLDER" ] || [ ! -e "$HYDRA_FOLDER/modules" ]; then
+ echo "Please make a symlink $HYDRA_FOLDER/modules pointing to your devel puppet modules."
+ exit 1
+fi
+
+cd $PUPPET
+HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }'`"
+
+cd $HYDRA_FOLDER/modules/$MODULE
+
+HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }'`"
+
+if [ "$HASH_MODULE" != "$HASH_SUBMODULE" ]; then
+ echo "Module $MODULE: hash differ!!:"
+ echo "Module: $HASH_MODULE"
+ echo "Submodule: $HASH_SUBMODULE"
+ exit 1
+fi
+
+echo "Latest commit hash match."