Files
ComponentCornerstone/hooks/pre-push
2023-03-01 15:30:22 +08:00

21 lines
441 B
Bash
Executable File

#!/bin/sh
remote="$1"
url="$2"
branch=$(git symbolic-ref --short -q HEAD)
strB="BUILD SUCCESSFUL"
echo "current branch:$branch"
tempLog=/tmp/$(date +%s).log && touch $tempLog
if [[ "$branch" =~ (^develop$)|(^release/*) ]]; then
./gradlew ComponentPublishDebug | tee $tempLog
result=$(cat $tempLog)
checkStr=$(echo "$result" | grep "${strB}")
if [[ "$checkStr" != "" ]]; then
exit 0;
else
exit 1;
fi
fi
exit 0;