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:
committed by
Tilmann Scheller
parent
d9979be2f6
commit
baeb83db8f
@@ -18,7 +18,7 @@
|
|||||||
# Usage
|
# Usage
|
||||||
function print_usage
|
function print_usage
|
||||||
{
|
{
|
||||||
echo "Usage: $0 [--help] [--tolerant]"
|
echo "Usage: $0 [--help] [--tolerant] [--travis]"
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_help
|
function print_help
|
||||||
@@ -32,6 +32,8 @@ function print_help
|
|||||||
echo " --tolerant check the existence of the message only but don't"
|
echo " --tolerant check the existence of the message only but don't"
|
||||||
echo " require the name and email address to match the author"
|
echo " require the name and email address to match the author"
|
||||||
echo " of the commit"
|
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 ""
|
||||||
echo "The last line of every commit message must follow the form of:"
|
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"
|
echo "'JerryScript-DCO-1.0-Signed-off-by: NAME EMAIL', where NAME and EMAIL must"
|
||||||
@@ -51,6 +53,18 @@ do
|
|||||||
then
|
then
|
||||||
TOLERANT="yes"
|
TOLERANT="yes"
|
||||||
shift
|
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
|
else
|
||||||
print_usage
|
print_usage
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
+1
-2
@@ -187,8 +187,7 @@ def main():
|
|||||||
ret = run_check([SIGNED_OFF_SCRIPT, '--tolerant'])
|
ret = run_check([SIGNED_OFF_SCRIPT, '--tolerant'])
|
||||||
|
|
||||||
if not ret and script_args.check_signed_off_travis:
|
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([SIGNED_OFF_SCRIPT, '--travis'])
|
||||||
ret = run_check(runnable)
|
|
||||||
|
|
||||||
if not ret and (script_args.all or script_args.check_signed_off):
|
if not ret and (script_args.all or script_args.check_signed_off):
|
||||||
ret = run_check(SIGNED_OFF_SCRIPT)
|
ret = run_check(SIGNED_OFF_SCRIPT)
|
||||||
|
|||||||
Reference in New Issue
Block a user