aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-08-10 13:12:49 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-08-10 13:12:49 -0300
commit683c19ba6468926f7e5fa354cb0c75c2900250cb (patch)
tree5de8e1f3f4453b4518ed1e7a328c6e38cadc0639 /share
parenta726a236c0b5c55447e6734b83f5465366824f9f (diff)
downloadhydra-683c19ba6468926f7e5fa354cb0c75c2900250cb.tar.gz
hydra-683c19ba6468926f7e5fa354cb0c75c2900250cb.tar.bz2
Adding module-verify action
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."