Adding push target. Handling empty commit list by early exit. Successful push message coloring.
This commit is contained in:
@@ -75,7 +75,7 @@ export color
|
|||||||
|
|
||||||
build: clean $(JERRY_TARGETS)
|
build: clean $(JERRY_TARGETS)
|
||||||
|
|
||||||
all: clean $(JERRY_TARGETS) $(TESTS_TARGET) $(CHECK_TARGETS)
|
all: precommit
|
||||||
|
|
||||||
PRECOMMIT_CHECK_TARGETS_LIST= debug.linux-sanitize.check \
|
PRECOMMIT_CHECK_TARGETS_LIST= debug.linux-sanitize.check \
|
||||||
debug.linux-valgrind.check \
|
debug.linux-valgrind.check \
|
||||||
@@ -85,7 +85,12 @@ PRECOMMIT_CHECK_TARGETS_LIST= debug.linux-sanitize.check \
|
|||||||
release.linux-musl-valgrind.check \
|
release.linux-musl-valgrind.check \
|
||||||
release.linux-libc_raw-valgrind.check
|
release.linux-libc_raw-valgrind.check
|
||||||
|
|
||||||
precommit: clean build
|
push: ./tools/push.sh
|
||||||
|
@ ./tools/push.sh
|
||||||
|
|
||||||
|
precommit: clean
|
||||||
|
@ echo -e "\nBuilding...\n\n"
|
||||||
|
@ $(MAKE) -s build
|
||||||
@ echo -e "\n================ Build completed successfully. Running precommit tests ================\n"
|
@ echo -e "\n================ Build completed successfully. Running precommit tests ================\n"
|
||||||
@ echo -e "All targets were built successfully. Starting unit tests' build and run.\n"
|
@ echo -e "All targets were built successfully. Starting unit tests' build and run.\n"
|
||||||
@ $(MAKE) -s unittests TESTS_OPTS="--silent"
|
@ $(MAKE) -s unittests TESTS_OPTS="--silent"
|
||||||
|
|||||||
+13
-3
@@ -45,7 +45,15 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
commits_to_push=`git log origin/master..master | grep "^commit [0-9a-f]*$" | awk 'BEGIN { s = "";} {s = $2" "s;} END {print s;}'`
|
commits_to_push=`git log origin/master..master | grep "^commit [0-9a-f]*$" | awk 'BEGIN { s = ""; } { s = $2" "s; } END { print s; }'`
|
||||||
|
|
||||||
|
echo $commits_to_push | grep "[^ ]"
|
||||||
|
status_code=$?
|
||||||
|
if [ $status_code -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Nothing to push"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "===== Starting pre-push commit testing series ====="
|
echo "===== Starting pre-push commit testing series ====="
|
||||||
@@ -90,12 +98,14 @@ echo
|
|||||||
|
|
||||||
if [ $ok_to_push -eq 1 ]
|
if [ $ok_to_push -eq 1 ]
|
||||||
then
|
then
|
||||||
if [ "`git status --porcelain 2>&1 | grep -v -e '^?? out/$$' | wc -l`" == "0" ]
|
if [ "`git status --porcelain 2>&1 | wc -l`" == "0" ]
|
||||||
then
|
then
|
||||||
echo "git push"
|
echo "Pushing..."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
git push
|
git push
|
||||||
|
|
||||||
|
echo -e "\e[0;32mPushed successfully\e[0m"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo -e "\e[1;33m $GIT_STATUS_NOT_CLEAN_MSG. $GIT_STATUS_CONSIDER_CLEAN_MSG.\e[0m\n"
|
echo -e "\e[1;33m $GIT_STATUS_NOT_CLEAN_MSG. $GIT_STATUS_CONSIDER_CLEAN_MSG.\e[0m\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user