Robert Collins | 18c9bbd | 2015-07-10 14:00:11 +1200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # An example hook script to verify what is about to be committed |
| 4 | # by applypatch from an e-mail message. |
| 5 | # |
| 6 | # The hook should exit with non-zero status after issuing an |
| 7 | # appropriate message if it wants to stop the commit. |
| 8 | # |
| 9 | # To enable this hook, rename this file to "pre-applypatch". |
| 10 | |
| 11 | set -eu |
| 12 | |
| 13 | #. git-sh-setup |
| 14 | echo "** in hook **" |
| 15 | |
| 16 | function test_version { |
| 17 | version=$1 |
| 18 | host=$(ls ~/.virtualenvs/mock-$version-* -d | sed -e "s/^.*mock-$version-//") |
| 19 | if [ -z "$host" ]; then |
| 20 | echo "No host found for $version" |
| 21 | return 1 |
| 22 | fi |
| 23 | echo testing $version in virtualenv mock-$version-$host on ssh host $host |
| 24 | ssh $host "cd work/mock && . ~/.virtualenvs/mock-$version-$host/bin/activate && pip install .[test] && unit2" |
| 25 | } |
| 26 | |
| 27 | find . -name "*.pyc" -exec rm "{}" \; |
| 28 | |
Robert Collins | 8747bf4 | 2015-07-15 18:37:33 +1200 | [diff] [blame] | 29 | test_version 2.6 |
Robert Collins | 18c9bbd | 2015-07-10 14:00:11 +1200 | [diff] [blame] | 30 | test_version 2.7 |
| 31 | test_version 3.2 |
| 32 | test_version 3.3 |
| 33 | test_version 3.4 |
| 34 | test_version 3.5 |
| 35 | test_version cpython |
| 36 | test_version pypy |
| 37 | |
| 38 | echo '** pre-apply complete and successful **' |