Makefile 1.11 KB
Newer Older
1 2 3
all:
	@echo "Run 'make imageoptim' to losslessly optimise all images"
	@echo "Run 'make minaccept' to run the quick pre-commit tests"
4
	@echo "Run 'make checksignoff' to check that your commits are all Signed-off-by"
5 6 7 8 9 10 11 12 13
	@echo "Run 'make push' to push your changes to the repo"

imageoptim:
	find . -iname '*.png' -exec optipng -o7 -q {} \;
	find . -iname '*.gif' -exec gifsicle -O2 -b {} \;
	find . -iname '*.jpg' -exec jpegoptim -q -p --strip-all {} \;
	find . -iname '*.jpeg' -exec jpegoptim -q -p --strip-all {} \;

minaccept:
14
	@echo "Running minimum acceptance test..."; find htdocs/ -type f -name "*.php" | xargs -n 1 -P 2 php -l > /dev/null && echo All good!
15

16 17 18 19 20 21 22 23 24 25 26
checksignoff:
	@branch=`git status | head -1 | sed 's/.* On branch //'`; \
	commits=`git log origin/$$branch.. | grep "^commit" | wc -l`; \
	signed=`git log origin/$$branch.. | grep "Signed-off-by: " | wc -l`; \
	if test "$$commits" -ne "$$signed"; then \
		echo "$$(($$commits - $$signed)) commit(s) on $$branch not signed off ($$signed/$$commits)"; \
		false; \
	else \
		echo "All commits signed!"; \
	fi

27
push: minaccept checksignoff
28
	git push gerrit HEAD:refs/for/master