Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | cd $WORKSPACE |
| 4 | rm -rf OnosSystemTest |
| 5 | rm -f pep8Result.txt |
| 6 | git clone https://gerrit.onosproject.org/OnosSystemTest; cd OnosSystemTest |
| 7 | git review -d ${GERRIT_CHANGE_NUMBER} |
| 8 | |
| 9 | cd |
| 10 | cd $WORKSPACE/OnosSystemTest/ |
| 11 | modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py) || modifiedFiles="" |
| 12 | if [ -n "$modifiedFiles" ] |
| 13 | then |
| 14 | pep8 --repeat --show-source --show-pep8 --ignore=E251,E201,E302,E202,E126,E127,E203,E226,E501,W391 $modifiedFiles > $WORKSPACE/pep8Result.txt |
| 15 | else |
| 16 | touch $WORKSPACE/pep8Result.txt |
| 17 | rm -rf $WORKSPACE/OnosSystemTest/ |
| 18 | echo "There were no files to code check, failing test so Jenkins doesn't comment." |
| 19 | exit 2 |
| 20 | fi |
| 21 | cat $WORKSPACE/pep8Result.txt |
| 22 | rm -rf $WORKSPACE/OnosSystemTest/ |