Move Travis CI detection logic from run-tests.py to check-signed-off.sh (#1341)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss 2016-09-12 15:11:14 +02:00 committed by Tilmann Scheller
parent d9979be2f6
commit baeb83db8f
2 changed files with 16 additions and 3 deletions

View File

@ -18,7 +18,7 @@
# Usage
function print_usage
{
echo "Usage: $0 [--help] [--tolerant]"
echo "Usage: $0 [--help] [--tolerant] [--travis]"
}
function print_help
@ -32,6 +32,8 @@ function print_help
echo " --tolerant check the existence of the message only but don't"
echo " require the name and email address to match the author"
echo " of the commit"
echo " --travis perform check in tolerant mode if on Travis CI and not"
echo " checking a pull request, perform strict check otherwise"
echo ""
echo "The last line of every commit message must follow the form of:"
echo "'JerryScript-DCO-1.0-Signed-off-by: NAME EMAIL', where NAME and EMAIL must"
@ -51,6 +53,18 @@ do
then
TOLERANT="yes"
shift
elif [ "$1" == "--travis" ]
then
if [ "$TRAVIS_PULL_REQUEST" == "" ]
then
echo -e "\e[1;33mWarning! Travis-tolerant mode requested but not running on Travis CI! \e[0m"
elif [ "$TRAVIS_PULL_REQUEST" == "false" ]
then
TOLERANT="yes"
else
TOLERANT="no"
fi
shift
else
print_usage
exit 1

View File

@ -187,8 +187,7 @@ def main():
ret = run_check([SIGNED_OFF_SCRIPT, '--tolerant'])
if not ret and script_args.check_signed_off_travis:
runnable = SIGNED_OFF_SCRIPT if os.getenv('TRAVIS_PULL_REQUEST', '0') != 'false' else [SIGNED_OFF_SCRIPT, '--tolerant']
ret = run_check(runnable)
ret = run_check([SIGNED_OFF_SCRIPT, '--travis'])
if not ret and (script_args.all or script_args.check_signed_off):
ret = run_check(SIGNED_OFF_SCRIPT)