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 11set -eu 12 13#. git-sh-setup 14echo "** in hook **" 15 16function 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 27find . -name "*.pyc" -exec rm "{}" \; 28 29test_version 2.7 30test_version 3.3 31test_version 3.4 32test_version 3.5 33test_version cpython 34test_version pypy 35 36echo '** pre-apply complete and successful **' 37