#!/bin/sh
################################################################################# # Build the cookbook, lint it and then clean it before pushing changes. # # Fail pushing if there are any errors. # ################################################################################# chef exec sambot build –local if [ $? -ne 0 ]; then
echo "Failed to build the cookbook. Aborting the Git push." exit 1
fi
chef exec foodcritic . if [ $? -ne 0 ]; then
echo "Failed when running Foodcritic. Aborting the Git push." exit 1
fi
chef exec cookstyle . if [ $? -ne 0 ]; then
echo "Failed when running Cookstyle. Aborting the Git push." exit 1
fi