Home | History | Annotate | Download | only in tools
      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 
     29 test_version 2.7
     30 test_version 3.3
     31 test_version 3.4
     32 test_version 3.5
     33 test_version cpython
     34 test_version pypy
     35 
     36 echo '** pre-apply complete and successful **'
     37