diff --git a/vars/tox.groovy b/vars/tox.groovy new file mode 100644 index 0000000..c26fcf3 --- /dev/null +++ b/vars/tox.groovy @@ -0,0 +1,7 @@ +def call() { + tmpdir = env.TMPDIR ? env.TMPDIR : '.' + sh """ +virtualenv -p python3 ${tmpdir}/venv/ +${tmpdir}/venv/bin/pip install tox +PGPORT=`python -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off ${tmpdir}/venv/bin/tox -rv""" +}